[llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp opt.cpp

Devang Patel dpatel at apple.com
Wed May 2 14:41:30 PDT 2007



Changes in directory llvm/tools/opt:

AnalysisWrappers.cpp updated: 1.22 -> 1.23
GraphPrinters.cpp updated: 1.15 -> 1.16
PrintSCC.cpp updated: 1.16 -> 1.17
opt.cpp updated: 1.135 -> 1.136
---
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:  (+16 -16)

 AnalysisWrappers.cpp |    8 ++++----
 GraphPrinters.cpp    |    4 ++--
 PrintSCC.cpp         |    8 ++++----
 opt.cpp              |   12 ++++++------
 4 files changed, 16 insertions(+), 16 deletions(-)


Index: llvm/tools/opt/AnalysisWrappers.cpp
diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.22 llvm/tools/opt/AnalysisWrappers.cpp:1.23
--- llvm/tools/opt/AnalysisWrappers.cpp:1.22	Tue May  1 16:15:47 2007
+++ llvm/tools/opt/AnalysisWrappers.cpp	Wed May  2 16:39:20 2007
@@ -30,7 +30,7 @@
   /// useful when looking for standard library functions we should constant fold
   /// or handle in alias analyses.
   struct ExternalFunctionsPassedConstants : public ModulePass {
-    static const int ID; // Pass ID, replacement for typeid
+    static const char ID; // Pass ID, replacement for typeid
     ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {}
     virtual bool runOnModule(Module &M) {
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
@@ -63,12 +63,12 @@
     }
   };
 
-  const int ExternalFunctionsPassedConstants::ID = 0;
+  const char ExternalFunctionsPassedConstants::ID = 0;
   RegisterPass<ExternalFunctionsPassedConstants>
   P1("externalfnconstants", "Print external fn callsites passed constants");
   
   struct CallGraphPrinter : public ModulePass {
-    static const int ID; // Pass ID, replacement for typeid
+    static const char ID; // Pass ID, replacement for typeid
     CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -82,7 +82,7 @@
     }
   };
   
-  const int CallGraphPrinter::ID = 0;
+  const char CallGraphPrinter::ID = 0;
   RegisterPass<CallGraphPrinter>
     P2("callgraph", "Print a call graph");
 }


Index: llvm/tools/opt/GraphPrinters.cpp
diff -u llvm/tools/opt/GraphPrinters.cpp:1.15 llvm/tools/opt/GraphPrinters.cpp:1.16
--- llvm/tools/opt/GraphPrinters.cpp:1.15	Tue May  1 16:15:47 2007
+++ llvm/tools/opt/GraphPrinters.cpp	Wed May  2 16:39:20 2007
@@ -60,7 +60,7 @@
 
 namespace {
   struct CallGraphPrinter : public ModulePass {
-    static const int ID; // Pass ID, replacement for typeid
+    static const char ID; // Pass ID, replacement for typeid
     CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
 
     virtual bool runOnModule(Module &M) {
@@ -77,7 +77,7 @@
     }
   };
 
-  const int CallGraphPrinter::ID = 0;
+  const char CallGraphPrinter::ID = 0;
   RegisterPass<CallGraphPrinter> P2("print-callgraph",
                                     "Print Call Graph to 'dot' file");
 }


Index: llvm/tools/opt/PrintSCC.cpp
diff -u llvm/tools/opt/PrintSCC.cpp:1.16 llvm/tools/opt/PrintSCC.cpp:1.17
--- llvm/tools/opt/PrintSCC.cpp:1.16	Tue May  1 16:15:47 2007
+++ llvm/tools/opt/PrintSCC.cpp	Wed May  2 16:39:20 2007
@@ -35,7 +35,7 @@
 
 namespace {
   struct CFGSCC : public FunctionPass {
-    static const int ID;  // Pass identification, replacement for typeid
+    static const char ID;  // Pass identification, replacement for typeid
     CFGSCC() : FunctionPass((intptr_t)&ID) {}
     bool runOnFunction(Function& func);
 
@@ -47,7 +47,7 @@
   };
 
   struct CallGraphSCC : public ModulePass {
-    static const int ID;  // Pass identification, replacement for typeid
+    static const char ID;  // Pass identification, replacement for typeid
     CallGraphSCC() : ModulePass((intptr_t)&ID) {}
 
     // run - Print out SCCs in the call graph for the specified module.
@@ -62,11 +62,11 @@
     }
   };
 
-  const int CFGSCC::ID = 0;
+  const char CFGSCC::ID = 0;
   RegisterPass<CFGSCC>
   Y("cfgscc", "Print SCCs of each function CFG");
 
-  const int CallGraphSCC::ID = 0;
+  const char CallGraphSCC::ID = 0;
   RegisterPass<CallGraphSCC>
   Z("callscc", "Print SCCs of the Call Graph");
 }


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.135 llvm/tools/opt/opt.cpp:1.136
--- llvm/tools/opt/opt.cpp:1.135	Tue May  1 16:15:47 2007
+++ llvm/tools/opt/opt.cpp	Wed May  2 16:39:20 2007
@@ -98,7 +98,7 @@
 namespace {
 
 struct ModulePassPrinter : public ModulePass {
-  static const int ID;
+  static const char ID;
   const PassInfo *PassToPrint;
   ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID),
                                           PassToPrint(PI) {}
@@ -121,10 +121,10 @@
   }
 };
 
-const int ModulePassPrinter::ID = 0;
+const char ModulePassPrinter::ID = 0;
 struct FunctionPassPrinter : public FunctionPass {
   const PassInfo *PassToPrint;
-  static const int ID;
+  static const char ID;
   FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID),
                                             PassToPrint(PI) {}
 
@@ -146,10 +146,10 @@
   }
 };
 
-const int FunctionPassPrinter::ID = 0;
+const char FunctionPassPrinter::ID = 0;
 struct BasicBlockPassPrinter : public BasicBlockPass {
   const PassInfo *PassToPrint;
-  static const int ID;
+  static const char ID;
   BasicBlockPassPrinter(const PassInfo *PI) 
     : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {}
 
@@ -172,7 +172,7 @@
   }
 };
 
-const int BasicBlockPassPrinter::ID = 0;
+const char BasicBlockPassPrinter::ID = 0;
 inline void addPass(PassManager &PM, Pass *P) {
   // Add the pass to the pass manager...
   PM.add(P);






More information about the llvm-commits mailing list