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

@@ -27,11 +27,11 @@
#include "projectpartutilities.h"
#include <refactoringcompileroptionsbuilder.h>
#include <refactoringserverinterface.h>
#include <requestsourcelocationforrenamingmessage.h>
#include <cpptools/clangcompileroptionsbuilder.h>
#include <cpptools/cpptoolsreuse.h>
#include <QTextCursor>
@@ -56,13 +56,18 @@ void RefactoringEngine::startLocalRenaming(const QTextCursor &textCursor,
CppTools::ProjectPart *projectPart,
RenameCallback &&renameSymbolsCallback)
{
using CppTools::ClangCompilerOptionsBuilder;
setUsable(false);
client.setLocalRenamingCallback(std::move(renameSymbolsCallback));
auto commandLine = RefactoringCompilerOptionsBuilder::build(projectPart,
fileKindInProjectPart(projectPart, filePath.toString()),
CppTools::getPchUsage());
Utils::SmallStringVector commandLine{ClangCompilerOptionsBuilder::build(
projectPart,
fileKindInProjectPart(projectPart, filePath.toString()),
CppTools::getPchUsage(),
CLANG_VERSION,
CLANG_RESOURCE_DIR)};
commandLine.push_back(filePath.toString());