Clang: Consolidate all ClangCompilerOptionsBuilder into one implementation

We used the same code in different but don't shared it. From a bug fixing
perspective it's actually not that smart.

Change-Id: Iaaffc883229e259ff77f95b5cf0a8f0d8b5117df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Marco Bubke
2016-12-14 14:56:17 +01:00
parent 11e0eaacc3
commit 1e3f2eec8d
13 changed files with 245 additions and 271 deletions

View File

@@ -28,7 +28,6 @@
#include "mockrefactoringserver.h"
#include "mockrefactoringclient.h"
#include <refactoringcompileroptionsbuilder.h>
#include <refactoringengine.h>
#include <requestsourcelocationforrenamingmessage.h>
@@ -36,8 +35,11 @@
#include <sourcelocationsforrenamingmessage.h>
#include <sourcerangesanddiagnosticsforquerymessage.h>
#include <cpptools/clangcompileroptionsbuilder.h>
#include <cpptools/projectpart.h>
#include <utils/smallstringvector.h>
#include <QTextCursor>
#include <QTextDocument>
@@ -45,7 +47,7 @@ namespace {
using testing::_;
using ClangRefactoring::RefactoringCompilerOptionsBuilder;
using CppTools::ClangCompilerOptionsBuilder;
using ClangBackEnd::RequestSourceLocationsForRenamingMessage;
@@ -128,9 +130,12 @@ void RefactoringEngine::SetUp()
projectPart = CppTools::ProjectPart::Ptr(new CppTools::ProjectPart);
projectPart->files.push_back(projectFile);
commandLine = RefactoringCompilerOptionsBuilder::build(projectPart.data(),
projectFile.kind,
RefactoringCompilerOptionsBuilder::PchUsage::None);
commandLine = Utils::SmallStringVector(ClangCompilerOptionsBuilder::build(
projectPart.data(),
projectFile.kind,
CppTools::CompilerOptionsBuilder::PchUsage::None,
CLANG_VERSION,
CLANG_RESOURCE_DIR));
commandLine.push_back(qStringFilePath);
}