summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-21 17:08:37 +0000
committerChris Lattner <sabre@nondot.org>2002-08-21 17:08:37 +0000
commit4b16963ca2d4bac95161196b5a4100ceef28683c (patch)
tree3b50129790d337b90a3a681068ef966eedec56ee /llvm/lib
parente87034074ffdff20409724c06cb9128c68ac5992 (diff)
downloadbcm5719-llvm-4b16963ca2d4bac95161196b5a4100ceef28683c.tar.gz
bcm5719-llvm-4b16963ca2d4bac95161196b5a4100ceef28683c.zip
- Eliminate the need for analyses to expose an ::ID member.
llvm-svn: 3414
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Pass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Pass.cpp b/llvm/lib/VMCore/Pass.cpp
index 1c54a1b2d19..b6f855d017e 100644
--- a/llvm/lib/VMCore/Pass.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud