aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-02-20 15:31:18 +0100
committerMarco Bubke <marco.bubke@qt.io>2017-02-20 16:09:05 +0000
commit58763aa996f8c975e50658c1dcb205831f4fbad5 (patch)
tree409bcca32481f6690d85cc229689edca5c750ac3 /src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
parenta66f3e8cc08c849d002880f6d4087245ca7b8564 (diff)
Clang: Silence warnings
Change-Id: I63f8a85f0a352fc8f41835bd3ab1574255d4436b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp')
-rw-r--r--src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp41
1 files changed, 35 insertions, 6 deletions
diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
index b4914eae2b5..8ae631eb2a2 100644
--- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
+++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
@@ -107,6 +107,40 @@ void ClangQueryProjectsFindFilter::setUnsavedContent(
this->unsavedContent = std::move(unsavedContent);
}
+Utils::SmallStringVector ClangQueryProjectsFindFilter::compilerArguments(CppTools::ProjectPart *projectPart,
+ CppTools::ProjectFile::Kind fileKind)
+{
+ using CppTools::ClangCompilerOptionsBuilder;
+
+ 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());
+}
+
namespace {
Utils::SmallStringVector createCommandLine(CppTools::ProjectPart *projectPart,
@@ -115,12 +149,7 @@ Utils::SmallStringVector createCommandLine(CppTools::ProjectPart *projectPart,
{
using CppTools::ClangCompilerOptionsBuilder;
- Utils::SmallStringVector commandLine{ClangCompilerOptionsBuilder::build(
- projectPart,
- fileKind,
- CppTools::CompilerOptionsBuilder::PchUsage::None,
- CLANG_VERSION,
- CLANG_RESOURCE_DIR)};
+ Utils::SmallStringVector commandLine = ClangQueryProjectsFindFilter::compilerArguments(projectPart, fileKind);
commandLine.push_back(documentFilePath);