diff options
author | dim <dim@FreeBSD.org> | 2016-01-08 17:32:42 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-01-08 17:32:42 +0000 |
commit | fa38d85e2c222400fa30c70e8a913e8a213a97a7 (patch) | |
tree | 44fa23b996e089a9c3388b72c9f5656f97e4aec6 /contrib/llvm/include | |
parent | ce1e0a9997edb90979d645fdd6160b14d1cf3d86 (diff) | |
download | FreeBSD-src-fa38d85e2c222400fa30c70e8a913e8a213a97a7.zip FreeBSD-src-fa38d85e2c222400fa30c70e8a913e8a213a97a7.tar.gz |
As submitted upstream in a review, avoid using undefined behavior in
llvm's LinkAllPasses.h. This caused some of the calls not to be
emitted, if the optimization level was -O2 or higher.
Conversely, if you used -O1 or lower, calls to e.g. RunningOnValgrind()
would be emitted, leading to link failures, because we did not include
Valgrind.cpp into libllvmsupport. Therefore, add it unconditionally.
Noticed by: ian
Diffstat (limited to 'contrib/llvm/include')
-rw-r--r-- | contrib/llvm/include/llvm/LinkAllPasses.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm/include/llvm/LinkAllPasses.h b/contrib/llvm/include/llvm/LinkAllPasses.h index 29fcd93..e4192bd 100644 --- a/contrib/llvm/include/llvm/LinkAllPasses.h +++ b/contrib/llvm/include/llvm/LinkAllPasses.h @@ -185,9 +185,9 @@ namespace { (void)new llvm::IntervalPartition(); (void)new llvm::ScalarEvolutionWrapperPass(); - ((llvm::Function*)nullptr)->viewCFGOnly(); + ((llvm::Function*)1)->viewCFGOnly(); llvm::RGPassManager RGM; - ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM); + ((llvm::RegionPass*)1)->runOnRegion((llvm::Region*)nullptr, RGM); llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr); X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets (void) llvm::AreStatisticsEnabled(); |