diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-21 17:08:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-21 17:08:37 +0000 |
commit | fb30fda1de96251017ae092f469de4b290b6b61b (patch) | |
tree | 26d2a47477e66df7b20cf4969b6c8c8b35b6e8b5 /lib/VMCore/Pass.cpp | |
parent | 7742799a80cec572fec56d50ed4039fc73754f90 (diff) | |
download | llvm-fb30fda1de96251017ae092f469de4b290b6b61b.tar.gz llvm-fb30fda1de96251017ae092f469de4b290b6b61b.tar.bz2 llvm-fb30fda1de96251017ae092f469de4b290b6b61b.tar.xz |
- Eliminate the need for analyses to expose an ::ID member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 1c54a1b2d1..b6f855d017 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -11,7 +11,6 @@ #include "llvm/Module.h" #include "Support/STLExtras.h" #include "Support/TypeInfo.h" -#include <typeinfo> #include <stdio.h> #include <sys/resource.h> #include <sys/unistd.h> @@ -371,8 +370,12 @@ static std::vector<PassRegistrationListener*> *Listeners = 0; // pass... const PassInfo *Pass::getPassInfo() const { if (PassInfoCache) return PassInfoCache; + return lookupPassInfo(typeid(*this)); +} + +const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) { if (PassInfoMap == 0) return 0; - std::map<TypeInfo, PassInfo*>::iterator I = PassInfoMap->find(typeid(*this)); + std::map<TypeInfo, PassInfo*>::iterator I = PassInfoMap->find(TI); return (I != PassInfoMap->end()) ? I->second : 0; } |