summaryrefslogtreecommitdiff
path: root/include/llvm/Target
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
committerDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
commit794fd75c67a2cdc128d67342c6d88a504d186896 (patch)
tree6b805aa4a576e9de6cbf096d2fb85063b3fb8fca /include/llvm/Target
parente50fb9ac174b791047ffa8648443ab94b2097cd9 (diff)
downloadllvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.gz
llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.bz2
llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.xz
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/Target')
-rw-r--r--include/llvm/Target/TargetData.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 4e330e862d..bfc41b1640 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -108,14 +108,15 @@ public:
///
/// @note This has to exist, because this is a pass, but it should never be
/// used.
- TargetData() {
+ TargetData() : ImmutablePass((intptr_t)&ID) {
assert(0 && "ERROR: Bad TargetData ctor used. "
"Tool did not specify a TargetData to use?");
abort();
}
/// Constructs a TargetData from a specification string. See init().
- TargetData(const std::string &TargetDescription) {
+ TargetData(const std::string &TargetDescription)
+ : ImmutablePass((intptr_t)&ID) {
init(TargetDescription);
}
@@ -123,7 +124,7 @@ public:
TargetData(const Module *M);
TargetData(const TargetData &TD) :
- ImmutablePass(),
+ ImmutablePass((intptr_t)&ID),
LittleEndian(TD.isLittleEndian()),
PointerMemSize(TD.PointerMemSize),
PointerABIAlign(TD.PointerABIAlign),
@@ -200,6 +201,8 @@ public:
/// specified global, returned in log form. This includes an explicitly
/// requested alignment (if the global has one).
unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const;
+
+ static const int ID; // Pass identifcation, replacement for typeid
};
/// StructLayout - used to lazily calculate structure layout information for a