[X86] Simplify X87 stackifier pass.
[oota-llvm.git] / tools / bugpoint / bugpoint.cpp
index e0941914d8d690937e596b9fcf98a425078ce4ab..c7dae0f45b663bb6e6ca3eb8575e6d14aa827d1b 100644 (file)
 #include "BugDriver.h"
 #include "ToolRunner.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/LegacyPassNameParser.h"
 #include "llvm/LinkAllIR.h"
 #include "llvm/LinkAllPasses.h"
 #include "llvm/PassManager.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PassNameParser.h"
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"
@@ -72,15 +72,15 @@ StandardLinkOpts("std-link-opts",
 
 static cl::opt<bool>
 OptLevelO1("O1",
-           cl::desc("Optimization level 1. Identical with 'opt -O1'"));
+           cl::desc("Optimization level 1. Identical to 'opt -O1'"));
 
 static cl::opt<bool>
 OptLevelO2("O2",
-           cl::desc("Optimization level 2. Identical with 'opt -O2'"));
+           cl::desc("Optimization level 2. Identical to 'opt -O2'"));
 
 static cl::opt<bool>
 OptLevelO3("O3",
-           cl::desc("Optimization level 3. Identical with 'opt -O3'"));
+           cl::desc("Optimization level 3. Identical to 'opt -O3'"));
 
 static cl::opt<std::string>
 OverrideTriple("mtriple", cl::desc("Override target triple for module"));
@@ -99,9 +99,9 @@ namespace {
   class AddToDriver : public FunctionPassManager {
     BugDriver &D;
   public:
-    AddToDriver(BugDriver &_D) : FunctionPassManager(0), D(_D) {}
+    AddToDriver(BugDriver &_D) : FunctionPassManager(nullptr), D(_D) {}
 
-    virtual void add(Pass *P) {
+    void add(Pass *P) override {
       const void *ID = P->getPassID();
       const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
       D.addPass(PI->getPassArgument());
@@ -109,6 +109,12 @@ namespace {
   };
 }
 
+#ifdef LINK_POLLY_INTO_TOOLS
+namespace polly {
+void initializePollyPasses(llvm::PassRegistry &Registry);
+}
+#endif
+
 int main(int argc, char **argv) {
 #ifndef DEBUG_BUGPOINT
   llvm::sys::PrintStackTraceOnErrorSignal();
@@ -130,6 +136,10 @@ int main(int argc, char **argv) {
   initializeInstrumentation(Registry);
   initializeTarget(Registry);
 
+#ifdef LINK_POLLY_INTO_TOOLS
+  polly::initializePollyPasses(Registry);
+#endif
+
   cl::ParseCommandLineOptions(argc, argv,
                               "LLVM automatic testcase reducer. See\nhttp://"
                               "llvm.org/cmds/bugpoint.html"