* Add support for different "PassType's"
authorChris Lattner <sabre@nondot.org>
Fri, 26 Jul 2002 21:12:46 +0000 (21:12 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 26 Jul 2002 21:12:46 +0000 (21:12 +0000)
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

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

23 files changed:
lib/Analysis/IPA/FindUnsafePointerTypes.cpp
lib/Analysis/IPA/FindUsedTypes.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/RaiseAllocations.cpp
lib/Transforms/Instrumentation/EmitFunctions.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/ConstantProp.cpp
lib/Transforms/Scalar/DCE.cpp
lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
lib/Transforms/Scalar/GCSE.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/PiNodeInsertion.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/SimplifyCFG.cpp
lib/Transforms/Scalar/SymbolStripping.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
lib/VMCore/AsmWriter.cpp

index 1180766f157a8491acf80ff3894cb278acc1f20b..2678fcf07d46e00eff339b87c5abcf1508d5c7e1 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Support/InstIterator.h"
 #include "Support/CommandLine.h"
 
+static RegisterAnalysis<FindUnsafePointerTypes>
+X("unsafepointertypes", "Find Unsafe Pointer Types");
 AnalysisID FindUnsafePointerTypes::ID(AnalysisID::create<FindUnsafePointerTypes>());
 
 // Provide a command line option to turn on printing of which instructions cause
index f91b8ae226ef6fd27340607d1cf9f69f947be049..1139cf3df8b96d644c569085e86ecc35648e3ab2 100644 (file)
@@ -11,6 +11,8 @@
 #include "llvm/Module.h"
 #include "llvm/Support/InstIterator.h"
 
+static RegisterAnalysis<FindUsedTypes>
+X("printusedtypes", "Find Used Types");
 AnalysisID FindUsedTypes::ID(AnalysisID::create<FindUsedTypes>());
 
 // IncorporateType - Incorporate one type and all of its subtypes into the
index 3c76a339ecae7af596352108ecf5723b2443f5df..924ad5c93afce27dcbd931a76877f1409733cd6d 100644 (file)
@@ -261,7 +261,7 @@ namespace {
       return doFunctionInlining(F);
     }
   };
-  RegisterPass<FunctionInlining> X("inline", "Function Integration/Inlining");
+  RegisterOpt<FunctionInlining> X("inline", "Function Integration/Inlining");
 }
 
 Pass *createFunctionInliningPass() { return new FunctionInlining(); }
index fae1767a3e5300cef7e6d4cdf789a93fe1b0b66e..0f10dad3c417a146f3c8640939067b5462e8101a 100644 (file)
@@ -39,8 +39,8 @@ public:
   bool runOnBasicBlock(BasicBlock &BB);
 };
 
-RegisterPass<RaiseAllocations>
-X("raiseallocs", "Raise allocations from calls to instructions");
+  RegisterOpt<RaiseAllocations>
+  X("raiseallocs", "Raise allocations from calls to instructions");
 }  // end anonymous namespace
 
 
index 3506cb90566c447e434a5ee18af4b36794102fc8..0218a146a694a048ff7fb24a3f26604565816f14 100644 (file)
@@ -17,7 +17,7 @@ namespace {
     bool run(Module &M);
   };
   
-  RegisterPass<EmitFunctionTable> X("emitfuncs", "Emit a Function Table");
+  RegisterOpt<EmitFunctionTable> X("emitfuncs", "Emit a Function Table");
 }
 
 // Create a new pass to add function table
index 52c7c0aa6492c5aba9c1e5f8b349ddf8ded3bd77..3239e73c98183c3234b62ad31e04c13bceecba3b 100644 (file)
@@ -97,8 +97,8 @@ namespace {
   };
 
   // Register the passes...
-  RegisterPass<FunctionTracer>  X("tracem","Insert Function trace code only");
-  RegisterPass<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
+  RegisterOpt<FunctionTracer>  X("tracem","Insert Function trace code only");
+  RegisterOpt<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
 } // end anonymous namespace
 
 
index 420cc79c7b1465a5172a56851809cb8861839528..b2008b08a134d05de3760b04053b13555797ea7d 100644 (file)
@@ -545,5 +545,5 @@ Pass *createRaisePointerReferencesPass(const TargetData &TD) {
   return new RaisePointerReferences(TD);
 }
 
-static RegisterPass<RaisePointerReferences>
+static RegisterOpt<RaisePointerReferences>
 X("raise", "Raise Pointer References", createRaisePointerReferencesPass);
index 058ef1b505506ed1ebaa5e2706dba36411c61e24..40ae87b5bbf28006ba84eddf94f8d59410c0dfc6 100644 (file)
@@ -84,7 +84,7 @@ private:
   }
 };
 
-  RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
+  RegisterOpt<ADCE> X("adce", "Aggressive Dead Code Elimination");
 } // End of anonymous namespace
 
 Pass *createAggressiveDCEPass() { return new ADCE(); }
index 025b8a79b238253d16d5e52a558e92f6c2606d2c..5da909e2020bc68ddaa04894ff7f84fdcf3b1067 100644 (file)
@@ -31,7 +31,7 @@ namespace {
     }
   };
 
-RegisterPass<ConstantPropogation> X("constprop", "Simple constant propogation");
+  RegisterOpt<ConstantPropogation> X("constprop","Simple constant propogation");
 }
 
 Pass *createConstantPropogationPass() {
index bfc41b14bca6f5ac769122e89dad2521caa8a17b..2903699a8d16697353492452bcc3269bf06ba029 100644 (file)
@@ -42,7 +42,7 @@ namespace {
     }
   };
   
-  RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
+  RegisterOpt<DeadInstElimination> X("die", "Dead Instruction Elimination");
 }
 
 Pass *createDeadInstEliminationPass() {
@@ -64,7 +64,7 @@ namespace {
     }
  };
 
-  RegisterPass<DCE> Y("dce", "Dead Code Elimination");
+  RegisterOpt<DCE> Y("dce", "Dead Code Elimination");
 }
 
 bool DCE::runOnFunction(Function &F) {
index 5d873cda2e1f0c90bd401fd38225069cc6dc2edc..f0a807497a77e76cd4f9ed4ad09e7fe620f0b178 100644 (file)
@@ -27,8 +27,8 @@ namespace {
     static void decomposeArrayRef(BasicBlock::iterator &BBI);
   };
 
-RegisterPass<DecomposePass> X("lowerrefs", "Decompose multi-dimensional "
-                              "structure/array references");
+  RegisterOpt<DecomposePass> X("lowerrefs", "Decompose multi-dimensional "
+                               "structure/array references");
 }
 
 Pass *createDecomposeMultiDimRefsPass() {
index 568f3db4f34802868aaf4763cdbe928409cd9c31..c8f87759767edca992f5002b56fb31742eb7262d 100644 (file)
@@ -84,7 +84,7 @@ namespace {
     }
   };
 
-  RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
+  RegisterOpt<GCSE> X("gcse", "Global Common Subexpression Elimination");
 }
 
 // createGCSEPass - The public interface to this file...
index 35fe697f0f9c63feccf6c3732c636343e0e671a3..411ab11fece088c2fc009ce7faf2cd356426aea9 100644 (file)
@@ -198,7 +198,7 @@ namespace {
       AU.preservesCFG();
     }
   };
-  RegisterPass<InductionVariableSimplify> X("indvars",
+  RegisterOpt<InductionVariableSimplify> X("indvars",
                                            "Cannonicalize Induction Variables");
 }
 
index ba2bbe0b05cf65e421dbcdba67c587d3120070ce..230b55365710bedcecb33e5301fd4bc930ca9b8f 100644 (file)
@@ -79,7 +79,7 @@ namespace {
     Instruction *visitInstruction(Instruction &I) { return 0; }
   };
 
-  RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
+  RegisterOpt<InstCombiner> X("instcombine", "Combine redundant instructions");
 }
 
 
index 99450bbd255c8e2147eca80dd1ce966019ef38d0..9f3c75705afa99c53e60dfb1e3ede527542e8a47 100644 (file)
@@ -103,7 +103,7 @@ namespace {
     }
   };
 
-  RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
+  RegisterOpt<LICM> X("licm", "Loop Invariant Code Motion");
 }
 
 Pass *createLICMPass() { return new LICM(); }
index 81f3cb3e9338c62212ff6552ac22e49d642cbb35..399b5fee88cba658c3ffa67ce88088ada7b2efe0 100644 (file)
@@ -55,7 +55,7 @@ namespace {
     bool insertPiNodeFor(Value *V, BasicBlock *BB, Value *Rep = 0);
   };
 
-  RegisterPass<PiNodeInserter> X("pinodes", "Pi Node Insertion");
+  RegisterOpt<PiNodeInserter> X("pinodes", "Pi Node Insertion");
 }
 
 Pass *createPiNodeInsertionPass() { return new PiNodeInserter(); }
index a6ad88a9ea653c3b6dc7c8a9aa721dac42e39f0d..24d7dcebe8e4fd022c2759d117c6f0d1d3cdef30 100644 (file)
@@ -47,7 +47,7 @@ namespace {
     bool ReassociateBB(BasicBlock *BB);
   };
 
-  RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
+  RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions");
 }
 
 Pass *createReassociatePass() { return new Reassociate(); }
index b32481e48bb9cea826822755e7042b7a672ef33a..b721ca0965c64611eeee27c501a53702e5d2612d 100644 (file)
@@ -220,7 +220,7 @@ private:
   }
 };
 
-  RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propogation");
+  RegisterOpt<SCCP> X("sccp", "Sparse Conditional Constant Propogation");
 } // end anonymous namespace
 
 
index 6774dc17a310fe1d4995ba31182bb5bf689b1db5..f26d5a01f82fe43c6a1b7cd30b89f90b13b0f8e8 100644 (file)
@@ -26,7 +26,7 @@ namespace {
   struct CFGSimplifyPass : public FunctionPass {
     virtual bool runOnFunction(Function &F);
   };
-  RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
+  RegisterOpt<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
 }
 
 Pass *createCFGSimplificationPass() {
index 4ad5af3a7f8de8076d7408fbe3a25fa62e512022..2f3d1aad6a8a70959301a375fd6a922bd92e9022 100644 (file)
@@ -51,15 +51,15 @@ namespace {
       AU.setPreservesAll();
     }
   };
-  RegisterPass<SymbolStripping> X("strip", "Strip symbols from functions");
+  RegisterOpt<SymbolStripping> X("strip", "Strip symbols from functions");
 
   struct FullSymbolStripping : public SymbolStripping {
     virtual bool doInitialization(Module &M) {
       return StripSymbolTable(M.getSymbolTable());
     }
   };
-  RegisterPass<FullSymbolStripping> Y("mstrip",
-                                    "Strip symbols from module and functions");
+  RegisterOpt<FullSymbolStripping> Y("mstrip",
+                                     "Strip symbols from module and functions");
 }
 
 Pass *createSymbolStrippingPass() {
index 486061fdf738f1b3a2918ea5e5b6b27c2286958f..7e0960dbf72e024ba2c3d7035357bf5f20eb81ff 100644 (file)
@@ -52,7 +52,7 @@ Pass *createLowerAllocationsPass(const TargetData &TD) {
   return new LowerAllocations(TD);
 }
 
-static RegisterPass<LowerAllocations>
+static RegisterOpt<LowerAllocations>
 X("lowerallocs", "Lower allocations from instructions to calls (TD)",
   createLowerAllocationsPass);
 
index 378e9799a8c107d427d516ca6f3cc1f5275c9f7b..0a92d0d9060b9c7f623602e7516d9fdf2227317d 100644 (file)
@@ -66,7 +66,7 @@ namespace {
     void FindSafeAllocas(Function &F);
   };
 
-  RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
+  RegisterOpt<PromotePass> X("mem2reg", "Promote Memory to Register");
 }  // end of anonymous namespace
 
 
index e33d9f400ab4b584595b3f1dae09563afeab68ab..c1af5e4c8567b98cf6a504062140abfe1821a5e3 100644 (file)
@@ -29,8 +29,10 @@ using std::map;
 using std::vector;
 using std::ostream;
 
-static RegisterPass<PrintModulePass>   X("printm", "Print module to stderr");
-static RegisterPass<PrintFunctionPass> Y("print", "Print function to stderr");
+static RegisterPass<PrintModulePass>
+X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
+static RegisterPass<PrintFunctionPass>
+Y("print","Print function to stderr",PassInfo::Analysis|PassInfo::Optimization);
 
 static void WriteAsOperandInternal(ostream &Out, const Value *V, bool PrintName,
                                    map<const Type *, string> &TypeTable,