[llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp

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



Changes in directory llvm/lib/Transforms/Hello:

Hello.cpp updated: 1.15 -> 1.16
---
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:  (+4 -4)

 Hello.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Transforms/Hello/Hello.cpp
diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.15 llvm/lib/Transforms/Hello/Hello.cpp:1.16
--- llvm/lib/Transforms/Hello/Hello.cpp:1.15	Tue May  1 16:15:46 2007
+++ llvm/lib/Transforms/Hello/Hello.cpp	Wed May  2 16:39:19 2007
@@ -25,7 +25,7 @@
 namespace {
   // Hello - The first implementation, without getAnalysisUsage.
   struct Hello : public FunctionPass {
-    static const int ID; // Pass identifcation, replacement for typeid
+    static const char ID; // Pass identifcation, replacement for typeid
     Hello() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
@@ -37,12 +37,12 @@
     }
   };
 
-  const int Hello::ID = 0;
+  const char Hello::ID = 0;
   RegisterPass<Hello> X("hello", "Hello World Pass");
 
   // Hello2 - The second implementation with getAnalysisUsage implemented.
   struct Hello2 : public FunctionPass {
-    static const int ID; // Pass identifcation, replacement for typeid
+    static const char ID; // Pass identifcation, replacement for typeid
     Hello2() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
@@ -58,7 +58,7 @@
       AU.setPreservesAll();
     };
   };
-  const int Hello2::ID = 0;
+  const char Hello2::ID = 0;
   RegisterPass<Hello2> Y("hello2",
                         "Hello World Pass (with getAnalysisUsage implemented)");
 }






More information about the llvm-commits mailing list