Clang: Unify compiler options builders

Make build command the same for all builders.
Minimize differences.

Change-Id: I1cfe5071b3afb4944ed178fff1e57d3aee45d8a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-09-11 14:08:00 +02:00
parent 736e568d94
commit 68a49c79da
15 changed files with 120 additions and 357 deletions

View File

@@ -155,31 +155,8 @@ Utils::SmallStringVector ClangQueryProjectsFindFilter::compilerArguments(CppTool
ClangCompilerOptionsBuilder builder(*projectPart, CLANG_VERSION, CLANG_RESOURCE_DIR);
builder.addWordWidth();
builder.addTargetTriple();
builder.addLanguageOption(fileKind);
builder.addOptionsForLanguage(/*checkForBorlandExtensions*/ true);
builder.enableExceptions();
builder.addDefineToAvoidIncludingGccOrMinGwIntrinsics();
builder.addDefineFloat128ForMingw();
builder.addToolchainAndProjectDefines();
builder.undefineCppLanguageFeatureMacrosForMsvc2015();
builder.addPredefinedMacrosAndHeaderPathsOptions();
builder.addWrappedQtHeadersIncludePath();
builder.addPrecompiledHeaderOptions(ClangCompilerOptionsBuilder::PchUsage::None);
builder.addHeaderPathOptions();
builder.addProjectConfigFileInclude();
builder.addMsvcCompatibilityVersion();
builder.add("-fmessage-length=0");
builder.add("-fmacro-backtrace-limit=0");
builder.add("-w");
builder.add("-ferror-limit=1000000");
return Utils::SmallStringVector(builder.options());
return Utils::SmallStringVector(builder.build(fileKind,
ClangCompilerOptionsBuilder::PchUsage::None));
}
QWidget *ClangQueryProjectsFindFilter::widget() const

View File

@@ -64,12 +64,10 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
QString filePath = data.filePath().toString();
QTextCursor textCursor = data.cursor();
Utils::SmallStringVector commandLine{ClangCompilerOptionsBuilder::build(
projectPart,
ClangCompilerOptionsBuilder clangCOBuilder{*projectPart, CLANG_VERSION, CLANG_RESOURCE_DIR};
Utils::SmallStringVector commandLine{clangCOBuilder.build(
fileKindInProjectPart(projectPart, filePath),
CppTools::getPchUsage(),
CLANG_VERSION,
CLANG_RESOURCE_DIR)};
CppTools::getPchUsage())};
commandLine.push_back(filePath);