[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
Wed May 2 14:41:38 PDT 2007



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.161 -> 1.162
BranchFolding.cpp updated: 1.47 -> 1.48
ELFWriter.cpp updated: 1.39 -> 1.40
ELFWriter.h updated: 1.2 -> 1.3
LiveIntervalAnalysis.cpp updated: 1.241 -> 1.242
LiveVariables.cpp updated: 1.80 -> 1.81
MachOWriter.cpp updated: 1.33 -> 1.34
MachOWriter.h updated: 1.4 -> 1.5
MachineFunction.cpp updated: 1.112 -> 1.113
MachineModuleInfo.cpp updated: 1.7 -> 1.8
PHIElimination.cpp updated: 1.58 -> 1.59
PrologEpilogInserter.cpp updated: 1.85 -> 1.86
RegAllocLinearScan.cpp updated: 1.146 -> 1.147
RegAllocLocal.cpp updated: 1.103 -> 1.104
RegAllocSimple.cpp updated: 1.84 -> 1.85
TwoAddressInstructionPass.cpp updated: 1.48 -> 1.49
UnreachableBlockElim.cpp updated: 1.10 -> 1.11
---
Log message:

Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces 
static const int, which defauts PassID based pass identification.


---
Diffs of the changes:  (+30 -30)

 AsmPrinter.cpp                |    2 +-
 BranchFolding.cpp             |    4 ++--
 ELFWriter.cpp                 |    2 +-
 ELFWriter.h                   |    2 +-
 LiveIntervalAnalysis.cpp      |    2 +-
 LiveVariables.cpp             |    2 +-
 MachOWriter.cpp               |    2 +-
 MachOWriter.h                 |    2 +-
 MachineFunction.cpp           |    8 ++++----
 MachineModuleInfo.cpp         |    6 +++---
 PHIElimination.cpp            |    4 ++--
 PrologEpilogInserter.cpp      |    4 ++--
 RegAllocLinearScan.cpp        |    4 ++--
 RegAllocLocal.cpp             |    4 ++--
 RegAllocSimple.cpp            |    4 ++--
 TwoAddressInstructionPass.cpp |    4 ++--
 UnreachableBlockElim.cpp      |    4 ++--
 17 files changed, 30 insertions(+), 30 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.161 llvm/lib/CodeGen/AsmPrinter.cpp:1.162
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.161	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Wed May  2 16:39:18 2007
@@ -32,7 +32,7 @@
 static cl::opt<bool>
 AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
 
-const int AsmPrinter::ID = 0;
+const char AsmPrinter::ID = 0;
 AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
                        const TargetAsmInfo *T)
   : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.47 llvm/lib/CodeGen/BranchFolding.cpp:1.48
--- llvm/lib/CodeGen/BranchFolding.cpp:1.47	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp	Wed May  2 16:39:18 2007
@@ -39,7 +39,7 @@
 
 namespace {
   struct BranchFolder : public MachineFunctionPass {
-    static const int ID;
+    static const char ID;
     BranchFolder() : MachineFunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
@@ -67,7 +67,7 @@
                         MachineBasicBlock *TBB, MachineBasicBlock *FBB,
                         const std::vector<MachineOperand> &Cond);
   };
-  const int BranchFolder::ID = 0;
+  const char BranchFolder::ID = 0;
 }
 
 FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }


Index: llvm/lib/CodeGen/ELFWriter.cpp
diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.39 llvm/lib/CodeGen/ELFWriter.cpp:1.40
--- llvm/lib/CodeGen/ELFWriter.cpp:1.39	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/ELFWriter.cpp	Wed May  2 16:39:18 2007
@@ -47,7 +47,7 @@
 #include <list>
 using namespace llvm;
 
-const int ELFWriter::ID = 0;
+const char ELFWriter::ID = 0;
 /// AddELFWriter - Concrete function to add the ELF writer to the function pass
 /// manager.
 MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,


Index: llvm/lib/CodeGen/ELFWriter.h
diff -u llvm/lib/CodeGen/ELFWriter.h:1.2 llvm/lib/CodeGen/ELFWriter.h:1.3
--- llvm/lib/CodeGen/ELFWriter.h:1.2	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/ELFWriter.h	Wed May  2 16:39:18 2007
@@ -30,7 +30,7 @@
   class ELFWriter : public MachineFunctionPass {
     friend class ELFCodeEmitter;
   public:
-    static const int ID;
+    static const char ID;
 
     MachineCodeEmitter &getMachineCodeEmitter() const {
       return *(MachineCodeEmitter*)MCE;


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.241 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.242
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.241	Wed May  2 15:37:47 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Wed May  2 16:39:18 2007
@@ -44,7 +44,7 @@
 STATISTIC(numFolded   , "Number of loads/stores folded into instructions");
 STATISTIC(numAborts   , "Number of times interval joining aborted");
 
-const int LiveIntervals::ID = 0;
+const char LiveIntervals::ID = 0;
 namespace {
   RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
 


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.80 llvm/lib/CodeGen/LiveVariables.cpp:1.81
--- llvm/lib/CodeGen/LiveVariables.cpp:1.80	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/LiveVariables.cpp	Wed May  2 16:39:18 2007
@@ -37,7 +37,7 @@
 #include <algorithm>
 using namespace llvm;
 
-const int LiveVariables::ID = 0;
+const char 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.33 llvm/lib/CodeGen/MachOWriter.cpp:1.34
--- llvm/lib/CodeGen/MachOWriter.cpp:1.33	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/MachOWriter.cpp	Wed May  2 16:39:19 2007
@@ -317,7 +317,7 @@
 //                          MachOWriter Implementation
 //===----------------------------------------------------------------------===//
 
-const int MachOWriter::ID = 0;
+const char MachOWriter::ID = 0;
 MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) 
   : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
   is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;


Index: llvm/lib/CodeGen/MachOWriter.h
diff -u llvm/lib/CodeGen/MachOWriter.h:1.4 llvm/lib/CodeGen/MachOWriter.h:1.5
--- llvm/lib/CodeGen/MachOWriter.h:1.4	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/MachOWriter.h	Wed May  2 16:39:19 2007
@@ -84,7 +84,7 @@
   class MachOWriter : public MachineFunctionPass {
     friend class MachOCodeEmitter;
   public:
-    static const int ID;
+    static const char ID;
     MachineCodeEmitter &getMachineCodeEmitter() const {
       return *(MachineCodeEmitter*)MCE;
     }


Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.112 llvm/lib/CodeGen/MachineFunction.cpp:1.113
--- llvm/lib/CodeGen/MachineFunction.cpp:1.112	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/MachineFunction.cpp	Wed May  2 16:39:19 2007
@@ -44,7 +44,7 @@
 
 namespace {
   struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
-    static const int ID;
+    static const char ID;
 
     std::ostream *OS;
     const std::string Banner;
@@ -64,7 +64,7 @@
       return false;
     }
   };
-  const int Printer::ID = 0;
+  const char Printer::ID = 0;
 }
 
 /// Returns a newly-created MachineFunction Printer pass. The default output
@@ -77,7 +77,7 @@
 
 namespace {
   struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
-    static const int ID;
+    static const char ID;
     Deleter() : MachineFunctionPass((intptr_t)&ID) {}
 
     const char *getPassName() const { return "Machine Code Deleter"; }
@@ -88,7 +88,7 @@
       return true;
     }
   };
-  const int Deleter::ID = 0;
+  const char 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.7 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.8
--- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.7	Wed May  2 15:37:47 2007
+++ llvm/lib/CodeGen/MachineModuleInfo.cpp	Wed May  2 16:39:19 2007
@@ -30,7 +30,7 @@
 namespace {
   RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
 }
-const int MachineModuleInfo::ID = 0;
+const char MachineModuleInfo::ID = 0;
 
 //===----------------------------------------------------------------------===//
 
@@ -1751,14 +1751,14 @@
 namespace llvm {
 
 struct DebugLabelFolder : public MachineFunctionPass {
-  static const int ID;
+  static const char ID;
   DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
 
   virtual bool runOnMachineFunction(MachineFunction &MF);
   virtual const char *getPassName() const { return "Label Folder"; }
 };
 
-const int  DebugLabelFolder::ID = 0;
+const char DebugLabelFolder::ID = 0;
 
 bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
   // Get machine module info.


Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.58 llvm/lib/CodeGen/PHIElimination.cpp:1.59
--- llvm/lib/CodeGen/PHIElimination.cpp:1.58	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/PHIElimination.cpp	Wed May  2 16:39:19 2007
@@ -33,7 +33,7 @@
 
 namespace {
   struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
-    static const int ID; // Pass identifcation, replacement for typeid
+    static const char ID; // Pass identifcation, replacement for typeid
     PNE() : MachineFunctionPass((intptr_t)&ID) {}
 
     bool runOnMachineFunction(MachineFunction &Fn) {
@@ -76,7 +76,7 @@
     VRegPHIUse VRegPHIUseCount;
   };
 
-  const int PNE::ID = 0;
+  const char 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.85 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.86
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.85	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp	Wed May  2 16:39:19 2007
@@ -32,7 +32,7 @@
 
 namespace {
   struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
-    static const int ID;
+    static const char ID;
     PEI() : MachineFunctionPass((intptr_t)&ID) {}
 
     const char *getPassName() const {
@@ -101,7 +101,7 @@
     void replaceFrameIndices(MachineFunction &Fn);
     void insertPrologEpilogCode(MachineFunction &Fn);
   };
-  const int PEI::ID = 0;
+  const char PEI::ID = 0;
 }
 
 


Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.147
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Wed May  2 16:39:19 2007
@@ -48,7 +48,7 @@
   static unsigned numIntervals = 0;
 
   struct VISIBILITY_HIDDEN RA : public MachineFunctionPass {
-    static const int ID;
+    static const char ID;
     RA() : MachineFunctionPass((intptr_t)&ID) {}
 
     typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
@@ -149,7 +149,7 @@
       }
     }
   };
-  const int RA::ID = 0;
+  const char RA::ID = 0;
 }
 
 void RA::ComputeRelatedRegClasses() {


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.103 llvm/lib/CodeGen/RegAllocLocal.cpp:1.104
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.103	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Wed May  2 16:39:19 2007
@@ -44,7 +44,7 @@
 
   class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
   public:
-    static const int ID;
+    static const char ID;
     RA() : MachineFunctionPass((intptr_t)&ID) {}
   private:
     const TargetMachine *TM;
@@ -228,7 +228,7 @@
     void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
                        unsigned PhysReg);
   };
-  const int RA::ID = 0;
+  const char 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.84 llvm/lib/CodeGen/RegAllocSimple.cpp:1.85
--- llvm/lib/CodeGen/RegAllocSimple.cpp:1.84	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/RegAllocSimple.cpp	Wed May  2 16:39:19 2007
@@ -39,7 +39,7 @@
 
   class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
   public:
-    static const int ID;
+    static const char ID;
     RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
   private:
     MachineFunction *MF;
@@ -94,7 +94,7 @@
     void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
                       unsigned VirtReg, unsigned PhysReg);
   };
-  const int RegAllocSimple::ID = 0;
+  const char 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.48 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.49
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.48	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Wed May  2 16:39:19 2007
@@ -50,7 +50,7 @@
 namespace {
   struct VISIBILITY_HIDDEN TwoAddressInstructionPass
    : public MachineFunctionPass {
-    static const int ID; // Pass identifcation, replacement for typeid
+    static const char ID; // Pass identifcation, replacement for typeid
     TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
@@ -59,7 +59,7 @@
     bool runOnMachineFunction(MachineFunction&);
   };
 
-  const int TwoAddressInstructionPass::ID = 0;
+  const char 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.10 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.11
--- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.10	Tue May  1 16:15:46 2007
+++ llvm/lib/CodeGen/UnreachableBlockElim.cpp	Wed May  2 16:39:19 2007
@@ -35,10 +35,10 @@
   class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
     virtual bool runOnFunction(Function &F);
   public:
-    static const int ID; // Pass identifcation, replacement for typeid
+    static const char ID; // Pass identifcation, replacement for typeid
     UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
   };
-  const int UnreachableBlockElim::ID = 0;
+  const char UnreachableBlockElim::ID = 0;
   RegisterPass<UnreachableBlockElim>
   X("unreachableblockelim", "Remove unreachable blocks from the CFG");
 }






More information about the llvm-commits mailing list