Fix PR1395, by passing the ID correctly
authorChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 23:13:56 +0000 (23:13 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 23:13:56 +0000 (23:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/IPO/Inliner.h

index 0367adc2acea19ce4e783c331c4e2bc0f4323558..14c19c9d6856e38540e3b32a25229c73aef9f669 100644 (file)
@@ -54,6 +54,7 @@ namespace {
   class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
     std::map<const Function*, FunctionInfo> CachedFunctionInfo;
   public:
+    SimpleInliner() : Inliner(&ID) {}
     static char ID; // Pass identification, replacement for typeid
     int getInlineCost(CallSite CS);
   };
index cd204a74334bee2e8966595d9f07446b48a25565..dd749c2ffc233b6cee6968a1a8b25ebf26791ebe 100644 (file)
@@ -36,9 +36,8 @@ namespace {
         cl::desc("Control the amount of inlining to perform (default = 200)"));
 }
 
-char Inliner::ID = 0;
-Inliner::Inliner() 
-  : CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {}
+Inliner::Inliner(const void *ID) 
+  : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {}
 
 /// getAnalysisUsage - For this class, we declare that we require and preserve
 /// the call graph.  If the derived class implements this method, it should
index 80be81a1e92ed91b7f46219424f2a62034f68dbc..cc58259373ba2c488f30b895c8dbf87f62c7f44b 100644 (file)
@@ -27,8 +27,7 @@ namespace llvm {
 /// perform the inlining operations that does not depend on the policy.
 ///
 struct Inliner : public CallGraphSCCPass {
-  static char ID;
-  Inliner();
+  Inliner(const void *ID);
 
   /// getAnalysisUsage - For this class, we declare that we require and preserve
   /// the call graph.  If the derived class implements this method, it should