diff options
author | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
commit | 794fd75c67a2cdc128d67342c6d88a504d186896 (patch) | |
tree | 6b805aa4a576e9de6cbf096d2fb85063b3fb8fca /include/llvm/Pass.h | |
parent | e50fb9ac174b791047ffa8648443ab94b2097cd9 (diff) | |
download | external_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.zip external_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.gz external_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.bz2 |
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
Diffstat (limited to 'include/llvm/Pass.h')
-rw-r--r-- | include/llvm/Pass.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 1ab6ff9..d678df6 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -34,8 +34,8 @@ #include <deque> #include <map> #include <iosfwd> -#include <typeinfo> #include <cassert> +#include <stdint.h> namespace llvm { @@ -77,7 +77,7 @@ typedef enum PassManagerType PassManagerType; /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - const PassInfo *PassInfoCache; + intptr_t PassID; // AnalysisImpls - This keeps track of which passes implement the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -87,7 +87,7 @@ class Pass { void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass() : Resolver(0), PassInfoCache(0) {} + Pass(intptr_t pid) : Resolver(0), PassID(pid) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually @@ -163,12 +163,12 @@ public: template<typename AnalysisClass> static const PassInfo *getClassPassInfo() { - return lookupPassInfo(typeid(AnalysisClass)); + return lookupPassInfo((intptr_t)&AnalysisClass::ID); } // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(const std::type_info &TI); + static const PassInfo *lookupPassInfo(intptr_t TI); /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be @@ -232,6 +232,7 @@ public: return PMT_ModulePassManager; } + ModulePass(intptr_t pid) : Pass(pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -256,6 +257,7 @@ public: /// virtual bool runOnModule(Module &M) { return false; } + ImmutablePass(intptr_t pid) : ModulePass(pid) {} // Force out-of-line virtual method. virtual ~ImmutablePass(); }; @@ -271,6 +273,8 @@ public: /// class FunctionPass : public Pass { public: + FunctionPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// @@ -320,6 +324,8 @@ public: /// class BasicBlockPass : public Pass { public: + BasicBlockPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// |