* Remove getPassName implementation
authorChris Lattner <sabre@nondot.org>
Tue, 23 Jul 2002 18:06:30 +0000 (18:06 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 23 Jul 2002 18:06:30 +0000 (18:06 +0000)
* Register all Passes

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

lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/FunctionResolution.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/RaiseAllocations.cpp
lib/Transforms/Utils/LowerAllocations.cpp

index 9a67dbdf198de9a1c6bc26a6a13f85ebcf9d0b54..71eadbf9829963bdbc92c973c04f970a7318c617 100644 (file)
@@ -23,8 +23,6 @@ static Statistic<> NumMerged("constmerge\t\t- Number of global constants merged"
 
 namespace {
   struct ConstantMerge : public Pass {
-    const char *getPassName() const {return "Merge Duplicate Global Constants";}
-    
     // run - For this pass, process all of the globals in the module,
     // eliminating duplicate constants.
     //
@@ -34,6 +32,8 @@ namespace {
       AU.preservesCFG();
     }
   };
+
+RegisterPass<ConstantMerge> X("constmerge", "Merge Duplicate Global Constants");
 }
 
 Pass *createConstantMergePass() { return new ConstantMerge(); }
index 683512689e31466e80d4362d665b621abf0135d2..19188cbfd1970e8f18860c13b6e74d4b6e5709d4 100644 (file)
@@ -30,10 +30,9 @@ namespace {
   Statistic<>NumResolved("funcresolve\t- Number of varargs functions resolved");
 
   struct FunctionResolvingPass : public Pass {
-    const char *getPassName() const { return "Resolve Functions"; }
-
     bool run(Module &M);
   };
+  RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
 }
 
 Pass *createFunctionResolvingPass() {
index 7d36e379bca48865221fe05a6b0fc295ccbdabad..3c76a339ecae7af596352108ecf5723b2443f5df 100644 (file)
@@ -257,11 +257,11 @@ static bool doFunctionInlining(Function &F) {
 
 namespace {
   struct FunctionInlining : public FunctionPass {
-    const char *getPassName() const { return "Function Inlining"; }
     virtual bool runOnFunction(Function &F) {
       return doFunctionInlining(F);
     }
   };
+  RegisterPass<FunctionInlining> X("inline", "Function Integration/Inlining");
 }
 
 Pass *createFunctionInliningPass() { return new FunctionInlining(); }
index 9ab3d5faf9454b52e8d776971a3a5f74e66e9e20..083be039e2a2ede3ec22bc147814217077f9c63c 100644 (file)
@@ -26,9 +26,7 @@ class RaiseAllocations : public BasicBlockPass {
   Function *MallocFunc;   // Functions in the module we are processing
   Function *FreeFunc;     // Initialized by doPassInitializationVirt
 public:
-  inline RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
-
-  const char *getPassName() const { return "Raise Allocations"; }
+  RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
 
   // doPassInitialization - For the raise allocations pass, this finds a
   // declaration for malloc and free if they exist.
@@ -41,6 +39,8 @@ public:
   bool runOnBasicBlock(BasicBlock &BB);
 };
 
+RegisterPass<RaiseAllocations>
+X("raiseallocs", "Raise allocations from calls to instructions");
 }  // end anonymous namespace
 
 
index 003be33182a8c36614649e70e09983febe70e546..a50cd8a5d11db2263b5272dfece787c213a9fe9a 100644 (file)
@@ -31,12 +31,10 @@ class LowerAllocations : public BasicBlockPass {
 
   const TargetData &DataLayout;
 public:
-  inline LowerAllocations(const TargetData &TD) : DataLayout(TD) {
+  LowerAllocations(const TargetData &TD) : DataLayout(TD) {
     MallocFunc = FreeFunc = 0;
   }
 
-  const char *getPassName() const { return "Lower Allocations"; }
-
   // doPassInitialization - For the lower allocations pass, this ensures that a
   // module contains a declaration for a malloc and a free function.
   //
@@ -47,7 +45,6 @@ public:
   //
   bool runOnBasicBlock(BasicBlock &BB);
 };
-
 }
 
 // createLowerAllocationsPass - Interface to this file...
@@ -55,6 +52,10 @@ Pass *createLowerAllocationsPass(const TargetData &TD) {
   return new LowerAllocations(TD);
 }
 
+static RegisterPass<LowerAllocations>
+X("lowerallocs", "Lower allocations from instructions to calls (TD)",
+  createLowerAllocationsPass);
+
 
 // doInitialization - For the lower allocations pass, this ensures that a
 // module contains a declaration for a malloc and a free function.