[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h

Devang Patel dpatel at apple.com
Tue May 1 14:18:01 PDT 2007



Changes in directory llvm/include/llvm/Target:

TargetData.h updated: 1.60 -> 1.61
---
Log message:

Do not use typeinfo to identify pass in pass manager.


---
Diffs of the changes:  (+6 -3)

 TargetData.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.60 llvm/include/llvm/Target/TargetData.h:1.61
--- llvm/include/llvm/Target/TargetData.h:1.60	Thu Apr 26 14:39:32 2007
+++ llvm/include/llvm/Target/TargetData.h	Tue May  1 16:15:46 2007
@@ -108,14 +108,15 @@
   ///
   /// @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 @@
   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 @@
   /// 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






More information about the llvm-commits mailing list