diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-04-23 09:44:12 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-04-24 10:35:40 +0000 |
commit | 5df7c12c5e7dc9cf76fa24808f121c7969992542 (patch) | |
tree | 9e7311bbb7bd473c225621b981cb3e7633a330c1 /dist | |
parent | da47a92611b6d6fbbb58cad84fb9cb257fe1a6c8 (diff) |
Clang: Fix mingw libclang build
Mingw miscompiles one of the static variables
in Clang-Tidy which results in clang driver
wrong return codes. Making it a local variable
solves the issue.
Change-Id: Ic834419e30bd45bbe728ffeb46181692c802fa06
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'dist')
-rw-r--r-- | dist/clang/patches/240_Link-clang-tools.patch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dist/clang/patches/240_Link-clang-tools.patch b/dist/clang/patches/240_Link-clang-tools.patch index 3a07e0a70a..0c2464d840 100644 --- a/dist/clang/patches/240_Link-clang-tools.patch +++ b/dist/clang/patches/240_Link-clang-tools.patch @@ -35,3 +35,26 @@ index 9f37c428ff..475c5f84c0 100644 +// This anchor is used to force the linker to link the clazy plugin. +extern volatile int ClazyPluginAnchorSource; +static int LLVM_ATTRIBUTE_UNUSED ClazyPluginAnchorDestination = ClazyPluginAnchorSource; +diff --git a/tools/clang/tools/extra/clang-tidy/modernize/LoopConvertCheck.cpp b/tools/clang/tools/extra/clang-tidy/modernize/LoopConvertCheck.cpp +index 54bf941f..49fabe9f 100644 +--- a/tools/clang/tools/extra/clang-tidy/modernize/LoopConvertCheck.cpp ++++ b/tools/clang/tools/extra/clang-tidy/modernize/LoopConvertCheck.cpp +@@ -44,9 +44,6 @@ static const char EndVarName[] = "endVar"; + static const char DerefByValueResultName[] = "derefByValueResult"; + static const char DerefByRefResultName[] = "derefByRefResult"; + +-// shared matchers +-static const TypeMatcher AnyType = anything(); +- + static const StatementMatcher IntegerComparisonMatcher = + expr(ignoringParenImpCasts( + declRefExpr(to(varDecl(hasType(isInteger())).bind(ConditionVarName))))); +@@ -173,6 +170,8 @@ StatementMatcher makeIteratorLoopMatcher() { + qualType(unless(hasCanonicalType(rValueReferenceType()))) + .bind(DerefByRefResultName))))))); + ++ static const TypeMatcher AnyType = anything(); ++ + return forStmt( + unless(isInTemplateInstantiation()), + hasLoopInit(anyOf(declStmt(declCountIs(2), |