[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp BranchFolding.cpp ELFWriter.cpp ELFWriter.h LiveIntervalAnalysis.cpp LiveVariables.cpp MachOWriter.cpp MachOWriter.h MachineFunction.cpp MachineModuleInfo.cpp PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp

Devang Patel dpatel at apple.com
Tue May 1 14:17:58 PDT 2007



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.160 -> 1.161
BranchFolding.cpp updated: 1.46 -> 1.47
ELFWriter.cpp updated: 1.38 -> 1.39
ELFWriter.h updated: 1.1 -> 1.2
LiveIntervalAnalysis.cpp updated: 1.239 -> 1.240
LiveVariables.cpp updated: 1.79 -> 1.80
MachOWriter.cpp updated: 1.32 -> 1.33
MachOWriter.h updated: 1.3 -> 1.4
MachineFunction.cpp updated: 1.111 -> 1.112
MachineModuleInfo.cpp updated: 1.5 -> 1.6
PHIElimination.cpp updated: 1.57 -> 1.58
PrologEpilogInserter.cpp updated: 1.84 -> 1.85
RegAllocLinearScan.cpp updated: 1.145 -> 1.146
RegAllocLocal.cpp updated: 1.102 -> 1.103
RegAllocSimple.cpp updated: 1.83 -> 1.84
TwoAddressInstructionPass.cpp updated: 1.47 -> 1.48
UnreachableBlockElim.cpp updated: 1.9 -> 1.10
---
Log message:

Do not use typeinfo to identify pass in pass manager.


---
Diffs of the changes:  (+64 -7)

 AsmPrinter.cpp                |    3 ++-
 BranchFolding.cpp             |    4 ++++
 ELFWriter.cpp                 |    4 +++-
 ELFWriter.h                   |    2 ++
 LiveIntervalAnalysis.cpp      |    1 +
 LiveVariables.cpp             |    1 +
 MachOWriter.cpp               |    4 +++-
 MachOWriter.h                 |    1 +
 MachineFunction.cpp           |   11 +++++++++--
 MachineModuleInfo.cpp         |    9 ++++++++-
 PHIElimination.cpp            |    4 ++++
 PrologEpilogInserter.cpp      |    4 ++++
 RegAllocLinearScan.cpp        |    4 ++++
 RegAllocLocal.cpp             |    5 +++++
 RegAllocSimple.cpp            |    6 +++++-
 TwoAddressInstructionPass.cpp |    4 ++++
 UnreachableBlockElim.cpp      |    4 ++++
 17 files changed, 64 insertions(+), 7 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.160 llvm/lib/CodeGen/AsmPrinter.cpp:1.161
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.160	Mon Apr 30 12:00:18 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Tue May  1 16:15:46 2007
@@ -32,9 +32,10 @@
 static cl::opt<bool>
 AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
 
+const int AsmPrinter::ID = 0;
 AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
                        const TargetAsmInfo *T)
-: FunctionNumber(0), O(o), TM(tm), TAI(T)
+  : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T)
 {}
 
 std::string AsmPrinter::getSectionForFunction(const Function &F) const {


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.46 llvm/lib/CodeGen/BranchFolding.cpp:1.47
--- llvm/lib/CodeGen/BranchFolding.cpp:1.46	Mon Apr 30 18:35:00 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp	Tue May  1 16:15:46 2007
@@ -39,6 +39,9 @@
 
 namespace {
   struct BranchFolder : public MachineFunctionPass {
+    static const int ID;
+    BranchFolder() : MachineFunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const { return "Control Flow Optimizer"; }
     const TargetInstrInfo *TII;
@@ -64,6 +67,7 @@
                         MachineBasicBlock *TBB, MachineBasicBlock *FBB,
                         const std::vector<MachineOperand> &Cond);
   };
+  const int BranchFolder::ID = 0;
 }
 
 FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }


Index: llvm/lib/CodeGen/ELFWriter.cpp
diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.38 llvm/lib/CodeGen/ELFWriter.cpp:1.39
--- llvm/lib/CodeGen/ELFWriter.cpp:1.38	Tue Feb 13 23:52:17 2007
+++ llvm/lib/CodeGen/ELFWriter.cpp	Tue May  1 16:15:46 2007
@@ -47,6 +47,7 @@
 #include <list>
 using namespace llvm;
 
+const int ELFWriter::ID = 0;
 /// AddELFWriter - Concrete function to add the ELF writer to the function pass
 /// manager.
 MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
@@ -176,7 +177,8 @@
 //                          ELFWriter Implementation
 //===----------------------------------------------------------------------===//
 
-ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
+ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) 
+  : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
   e_flags = 0;    // e_flags defaults to 0, no flags.
 
   is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;


Index: llvm/lib/CodeGen/ELFWriter.h
diff -u llvm/lib/CodeGen/ELFWriter.h:1.1 llvm/lib/CodeGen/ELFWriter.h:1.2
--- llvm/lib/CodeGen/ELFWriter.h:1.1	Wed Feb  7 19:30:50 2007
+++ llvm/lib/CodeGen/ELFWriter.h	Tue May  1 16:15:46 2007
@@ -30,6 +30,8 @@
   class ELFWriter : public MachineFunctionPass {
     friend class ELFCodeEmitter;
   public:
+    static const int ID;
+
     MachineCodeEmitter &getMachineCodeEmitter() const {
       return *(MachineCodeEmitter*)MCE;
     }


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.239 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.240
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.239	Thu Apr 26 13:59:33 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Tue May  1 16:15:46 2007
@@ -45,6 +45,7 @@
 STATISTIC(numAborts   , "Number of times interval joining aborted");
 
 namespace {
+  const int LiveIntervals::ID = 0;
   RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
 
   static cl::opt<bool>


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.79 llvm/lib/CodeGen/LiveVariables.cpp:1.80
--- llvm/lib/CodeGen/LiveVariables.cpp:1.79	Thu Apr 26 13:59:33 2007
+++ llvm/lib/CodeGen/LiveVariables.cpp	Tue May  1 16:15:46 2007
@@ -37,6 +37,7 @@
 #include <algorithm>
 using namespace llvm;
 
+const int LiveVariables::ID = 0;
 static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis");
 
 void LiveVariables::VarInfo::dump() const {


Index: llvm/lib/CodeGen/MachOWriter.cpp
diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.32 llvm/lib/CodeGen/MachOWriter.cpp:1.33
--- llvm/lib/CodeGen/MachOWriter.cpp:1.32	Sat Mar  3 22:41:04 2007
+++ llvm/lib/CodeGen/MachOWriter.cpp	Tue May  1 16:15:46 2007
@@ -317,7 +317,9 @@
 //                          MachOWriter Implementation
 //===----------------------------------------------------------------------===//
 
-MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
+const int MachOWriter::ID = 0;
+MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) 
+  : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
   is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
   isLittleEndian = TM.getTargetData()->isLittleEndian();
 


Index: llvm/lib/CodeGen/MachOWriter.h
diff -u llvm/lib/CodeGen/MachOWriter.h:1.3 llvm/lib/CodeGen/MachOWriter.h:1.4
--- llvm/lib/CodeGen/MachOWriter.h:1.3	Mon Apr 16 13:10:22 2007
+++ llvm/lib/CodeGen/MachOWriter.h	Tue May  1 16:15:46 2007
@@ -84,6 +84,7 @@
   class MachOWriter : public MachineFunctionPass {
     friend class MachOCodeEmitter;
   public:
+    static const int ID;
     MachineCodeEmitter &getMachineCodeEmitter() const {
       return *(MachineCodeEmitter*)MCE;
     }


Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.111 llvm/lib/CodeGen/MachineFunction.cpp:1.112
--- llvm/lib/CodeGen/MachineFunction.cpp:1.111	Wed Apr 25 17:10:09 2007
+++ llvm/lib/CodeGen/MachineFunction.cpp	Tue May  1 16:15:46 2007
@@ -44,11 +44,13 @@
 
 namespace {
   struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
+    static const int ID;
+
     std::ostream *OS;
     const std::string Banner;
 
-    Printer (std::ostream *_OS, const std::string &_Banner) :
-      OS (_OS), Banner (_Banner) { }
+    Printer (std::ostream *_OS, const std::string &_Banner) 
+      : MachineFunctionPass((intptr_t)&ID), OS (_OS), Banner (_Banner) { }
 
     const char *getPassName() const { return "MachineFunction Printer"; }
 
@@ -62,6 +64,7 @@
       return false;
     }
   };
+  const int Printer::ID = 0;
 }
 
 /// Returns a newly-created MachineFunction Printer pass. The default output
@@ -74,6 +77,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
+    static const int ID;
+    Deleter() : MachineFunctionPass((intptr_t)&ID) {}
+
     const char *getPassName() const { return "Machine Code Deleter"; }
 
     bool runOnMachineFunction(MachineFunction &MF) {
@@ -82,6 +88,7 @@
       return true;
     }
   };
+  const int Deleter::ID = 0;
 }
 
 /// MachineCodeDeletion Pass - This pass deletes all of the machine code for


Index: llvm/lib/CodeGen/MachineModuleInfo.cpp
diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.5 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.6
--- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.5	Thu Mar  1 14:25:32 2007
+++ llvm/lib/CodeGen/MachineModuleInfo.cpp	Tue May  1 16:15:46 2007
@@ -28,6 +28,7 @@
 
 // Handle the Pass registration stuff necessary to use TargetData's.
 namespace {
+  const int MachineModuleInfo::ID = 0;
   RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
 }
 
@@ -1462,7 +1463,8 @@
 //===----------------------------------------------------------------------===//
 
 MachineModuleInfo::MachineModuleInfo()
-: DR()
+: ImmutablePass((intptr_t)&ID)
+, DR()
 , VR()
 , CompileUnits()
 , Directories()
@@ -1749,10 +1751,15 @@
 namespace llvm {
 
 struct DebugLabelFolder : public MachineFunctionPass {
+  static const int ID;
+  DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
+
   virtual bool runOnMachineFunction(MachineFunction &MF);
   virtual const char *getPassName() const { return "Label Folder"; }
 };
 
+const int  DebugLabelFolder::ID = 0;
+
 bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
   // Get machine module info.
   MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();


Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.57 llvm/lib/CodeGen/PHIElimination.cpp:1.58
--- llvm/lib/CodeGen/PHIElimination.cpp:1.57	Wed Apr 18 00:04:38 2007
+++ llvm/lib/CodeGen/PHIElimination.cpp	Tue May  1 16:15:46 2007
@@ -33,6 +33,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    PNE() : MachineFunctionPass((intptr_t)&ID) {}
+
     bool runOnMachineFunction(MachineFunction &Fn) {
       analyzePHINodes(Fn);
 
@@ -73,6 +76,7 @@
     VRegPHIUse VRegPHIUseCount;
   };
 
+  const int PNE::ID = 0;
   RegisterPass<PNE> X("phi-node-elimination",
                       "Eliminate PHI nodes for register allocation");
 }


Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.84 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.85
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.84	Tue May  1 04:01:42 2007
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp	Tue May  1 16:15:46 2007
@@ -32,6 +32,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
+    static const int ID;
+    PEI() : MachineFunctionPass((intptr_t)&ID) {}
+
     const char *getPassName() const {
       return "Prolog/Epilog Insertion & Frame Finalization";
     }
@@ -98,6 +101,7 @@
     void replaceFrameIndices(MachineFunction &Fn);
     void insertPrologEpilogCode(MachineFunction &Fn);
   };
+  const int PEI::ID = 0;
 }
 
 


Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.145 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.145	Wed Apr 25 17:11:48 2007
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Tue May  1 16:15:46 2007
@@ -48,6 +48,9 @@
   static unsigned numIntervals = 0;
 
   struct VISIBILITY_HIDDEN RA : public MachineFunctionPass {
+    static const int ID;
+    RA() : MachineFunctionPass((intptr_t)&ID) {}
+
     typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
     typedef std::vector<IntervalPtr> IntervalPtrs;
   private:
@@ -146,6 +149,7 @@
       }
     }
   };
+  const int RA::ID = 0;
 }
 
 void RA::ComputeRelatedRegClasses() {


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.102 llvm/lib/CodeGen/RegAllocLocal.cpp:1.103
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.102	Wed Apr 25 17:11:48 2007
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Tue May  1 16:15:46 2007
@@ -43,6 +43,10 @@
 
 
   class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
+  public:
+    static const int ID;
+    RA() : MachineFunctionPass((intptr_t)&ID) {}
+  private:
     const TargetMachine *TM;
     MachineFunction *MF;
     const MRegisterInfo *RegInfo;
@@ -224,6 +228,7 @@
     void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
                        unsigned PhysReg);
   };
+  const int RA::ID = 0;
 }
 
 /// getStackSpaceFor - This allocates space for the specified virtual register


Index: llvm/lib/CodeGen/RegAllocSimple.cpp
diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.83 llvm/lib/CodeGen/RegAllocSimple.cpp:1.84
--- llvm/lib/CodeGen/RegAllocSimple.cpp:1.83	Wed Apr 25 17:11:48 2007
+++ llvm/lib/CodeGen/RegAllocSimple.cpp	Tue May  1 16:15:46 2007
@@ -38,6 +38,10 @@
                    createSimpleRegisterAllocator);
 
   class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
+  public:
+    static const int ID;
+    RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
+  private:
     MachineFunction *MF;
     const TargetMachine *TM;
     const MRegisterInfo *RegInfo;
@@ -90,7 +94,7 @@
     void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
                       unsigned VirtReg, unsigned PhysReg);
   };
-
+  const int RegAllocSimple::ID = 0;
 }
 
 /// getStackSpaceFor - This allocates space for the specified virtual


Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.47 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.48
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.47	Wed Apr 18 00:04:38 2007
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Tue May  1 16:15:46 2007
@@ -50,12 +50,16 @@
 namespace {
   struct VISIBILITY_HIDDEN TwoAddressInstructionPass
    : public MachineFunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
+
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
 
     /// runOnMachineFunction - pass entry point
     bool runOnMachineFunction(MachineFunction&);
   };
 
+  const int TwoAddressInstructionPass::ID = 0;
   RegisterPass<TwoAddressInstructionPass>
   X("twoaddressinstruction", "Two-Address instruction pass");
 }


Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp
diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.9 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.10
--- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.9	Sun Aug 27 17:42:51 2006
+++ llvm/lib/CodeGen/UnreachableBlockElim.cpp	Tue May  1 16:15:46 2007
@@ -34,7 +34,11 @@
 namespace {
   class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
     virtual bool runOnFunction(Function &F);
+  public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
   };
+  const int UnreachableBlockElim::ID = 0;
   RegisterPass<UnreachableBlockElim>
   X("unreachableblockelim", "Remove unreachable blocks from the CFG");
 }






More information about the llvm-commits mailing list