LinkAllPasses.h: also link in parts of libLLVMSupport
authorDmitri Gribenko <gribozavr@gmail.com>
Tue, 14 Apr 2015 03:49:53 +0000 (03:49 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Tue, 14 Apr 2015 03:49:53 +0000 (03:49 +0000)
When a loadable (.so or .dylib) pass is built with assertions enabled and
loaded into the 'opt' tool, we need to ensure that the extra symbols that such
passes depend on are linked into the tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234851 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/LinkAllPasses.h

index d00882d27c492f94b9a18e72fb404d972d9cd158..5fa7f342a43e82fd42d03287b9e4e6ec3a76b29b 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef LLVM_LINKALLPASSES_H
 #define LLVM_LINKALLPASSES_H
 
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/AliasSetTracker.h"
 #include "llvm/Analysis/CallPrinter.h"
 #include "llvm/Analysis/DomPrinter.h"
@@ -35,6 +36,7 @@
 #include "llvm/Transforms/Utils/SymbolRewriter.h"
 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
 #include "llvm/Transforms/Vectorize.h"
+#include "llvm/Support/Valgrind.h"
 #include <cstdlib>
 
 namespace {
@@ -179,6 +181,8 @@ namespace {
       ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
       X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
+      (void) llvm::AreStatisticsEnabled();
+      (void) llvm::sys::RunningOnValgrind();
     }
   } ForcePassLinking; // Force link by creating a global definition.
 }