Factory methods for function passes now return type FunctionPass *.
authorBrian Gaeke <gaeke@uiuc.edu>
Thu, 14 Aug 2003 06:04:49 +0000 (06:04 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Thu, 14 Aug 2003 06:04:49 +0000 (06:04 +0000)
Get rid of RegisterLLC, which can't handle FunctionPasses anyway.

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

lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/SparcV9PeepholeOpts.cpp

index a666c5fe2e1ce7af3f3263ee28993dae819af190..835169aeeb8b01add074ac00737a67dcd85b2aae 100644 (file)
@@ -71,13 +71,10 @@ namespace {
     }
     
     bool runOnFunction(Function &F);
+    virtual const char *getPassName() const { return "Instruction Selection"; }
   };
 }
 
-// Register the pass...
-static RegisterLLC<InstructionSelection>
-X("instselect", "Instruction Selection", createInstructionSelectionPass);
-
 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
                                Value *s1, Value *s2, const std::string &name)
   : Instruction(s1->getType(), Instruction::UserOp1, name)
@@ -384,6 +381,6 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 // createInstructionSelectionPass - Public entrypoint for instruction selection
 // and this file as a whole...
 //
-Pass *createInstructionSelectionPass(TargetMachine &T) {
+FunctionPass *createInstructionSelectionPass(TargetMachine &T) {
   return new InstructionSelection(T);
 }
index a666c5fe2e1ce7af3f3263ee28993dae819af190..835169aeeb8b01add074ac00737a67dcd85b2aae 100644 (file)
@@ -71,13 +71,10 @@ namespace {
     }
     
     bool runOnFunction(Function &F);
+    virtual const char *getPassName() const { return "Instruction Selection"; }
   };
 }
 
-// Register the pass...
-static RegisterLLC<InstructionSelection>
-X("instselect", "Instruction Selection", createInstructionSelectionPass);
-
 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
                                Value *s1, Value *s2, const std::string &name)
   : Instruction(s1->getType(), Instruction::UserOp1, name)
@@ -384,6 +381,6 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 // createInstructionSelectionPass - Public entrypoint for instruction selection
 // and this file as a whole...
 //
-Pass *createInstructionSelectionPass(TargetMachine &T) {
+FunctionPass *createInstructionSelectionPass(TargetMachine &T) {
   return new InstructionSelection(T);
 }
index 73e9ec942a3f157f8e726f785fd1cdb5a898f7f1..3912f4e7629c5e75e059f1107276aa36e58ce3a9 100644 (file)
@@ -68,12 +68,6 @@ public:
   bool runOnBasicBlock(BasicBlock &BB); // apply this pass to each BB
 };
 
-
-// Register the pass with llc only, and not opt...
-static RegisterLLC<PeepholeOpts>
-X("peephole", "Peephole Optimization", createPeepholeOptsPass);
-
-
 /* Apply a list of peephole optimizations to this machine instruction
  * within its local context.  They are allowed to delete MI or any
  * instruction before MI, but not 
@@ -128,7 +122,7 @@ PeepholeOpts::runOnBasicBlock(BasicBlock &BB)
 // createPeepholeOptsPass - Public entrypoint for peephole optimization
 // and this file as a whole...
 //
-Pass*
+FunctionPass*
 createPeepholeOptsPass(TargetMachine &T)
 {
   return new PeepholeOpts(T);