From 794fd75c67a2cdc128d67342c6d88a504d186896 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 1 May 2007 21:15:47 +0000 Subject: Do not use typeinfo to identify pass in pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/RSProfiling.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Transforms/Instrumentation/RSProfiling.cpp') diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index f97b2bcd3e..ad9a841cb0 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -69,6 +69,7 @@ namespace { /// measuring framework overhead class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers { public: + static const int ID; // Pass identifcation, replacement for typeid bool isProfiling(Value* v) { return false; } @@ -80,7 +81,9 @@ namespace { } }; + const int RSProfilers::ID = 0; static RegisterAnalysisGroup A("Profiling passes"); + const int NullProfilerRS::ID = 0; static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT(NP); @@ -138,6 +141,9 @@ namespace { /// ProfilerRS - Insert the random sampling framework struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + ProfilerRS() : FunctionPass((intptr_t)&ID) {} + std::map TransCache; std::set ChoicePoints; Chooser* c; @@ -154,6 +160,7 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; + const int ProfilerRS::ID = 0; RegisterPass X("insert-rs-profiling-framework", "Insert random sampling instrumentation framework"); } -- cgit v1.2.3