From 1ce6f8da7283a1f281f1767905873537d66560d5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 23:13:56 +0000 Subject: [PATCH] Fix PR1395, by passing the ID correctly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36894 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/InlineSimple.cpp | 1 + lib/Transforms/IPO/Inliner.cpp | 5 ++--- lib/Transforms/IPO/Inliner.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 0367adc2acea1..14c19c9d6856e 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -54,6 +54,7 @@ namespace { class VISIBILITY_HIDDEN SimpleInliner : public Inliner { std::map CachedFunctionInfo; public: + SimpleInliner() : Inliner(&ID) {} static char ID; // Pass identification, replacement for typeid int getInlineCost(CallSite CS); }; diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index cd204a74334be..dd749c2ffc233 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -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 diff --git a/lib/Transforms/IPO/Inliner.h b/lib/Transforms/IPO/Inliner.h index 80be81a1e92ed..cc58259373ba2 100644 --- a/lib/Transforms/IPO/Inliner.h +++ b/lib/Transforms/IPO/Inliner.h @@ -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