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
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp
index 6eead0f..27da816 100644
--- a/lib/Analysis/ProfileInfo.cpp
+++ b/lib/Analysis/ProfileInfo.cpp
@@ -22,6 +22,7 @@
// Register the ProfileInfo interface, providing a nice name to refer to.
namespace {
+ const int ProfileInfo::ID = 0;
RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
}
@@ -84,8 +85,12 @@
namespace {
struct VISIBILITY_HIDDEN NoProfileInfo
- : public ImmutablePass, public ProfileInfo {};
+ : public ImmutablePass, public ProfileInfo {
+ static const int ID; // Class identification, replacement for typeinfo
+ NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
+ };
+ const int NoProfileInfo::ID = 0;
// Register this pass...
RegisterPass<NoProfileInfo>
X("no-profile", "No Profile Information");