Do not use explicit casts that hide the dependence on Instruction being
authorChris Lattner <sabre@nondot.org>
Sun, 29 Feb 2004 19:02:26 +0000 (19:02 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Feb 2004 19:02:26 +0000 (19:02 +0000)
annotable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12000 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineCodeForInstruction.h
lib/Target/SparcV9/MachineCodeForInstruction.h

index 9a08de79afab9ac6308706a60a969c07caf5b132..bc457f39579e851256a094a2f8934f4e73c50db5 100644 (file)
@@ -45,14 +45,8 @@ public:
   MachineCodeForInstruction() : Annotation(MCFI_AID), callArgsDesc(NULL) {}
   ~MachineCodeForInstruction();
   
-  static MachineCodeForInstruction &get(const Instruction *I) {
-    assert(I != NULL);
-    return *(MachineCodeForInstruction*)
-      ((Annotable*)I)->getOrCreateAnnotation(MCFI_AID);
-  }
-  static void destroy(const Instruction *I) {
-    ((Annotable*)I)->deleteAnnotation(MCFI_AID);
-  }
+  static MachineCodeForInstruction &get(const Instruction *I);
+  static void destroy(const Instruction *I);
 
   // Access to underlying machine instructions...
   typedef std::vector<MachineInstr*>::iterator iterator;
index 9a08de79afab9ac6308706a60a969c07caf5b132..bc457f39579e851256a094a2f8934f4e73c50db5 100644 (file)
@@ -45,14 +45,8 @@ public:
   MachineCodeForInstruction() : Annotation(MCFI_AID), callArgsDesc(NULL) {}
   ~MachineCodeForInstruction();
   
-  static MachineCodeForInstruction &get(const Instruction *I) {
-    assert(I != NULL);
-    return *(MachineCodeForInstruction*)
-      ((Annotable*)I)->getOrCreateAnnotation(MCFI_AID);
-  }
-  static void destroy(const Instruction *I) {
-    ((Annotable*)I)->deleteAnnotation(MCFI_AID);
-  }
+  static MachineCodeForInstruction &get(const Instruction *I);
+  static void destroy(const Instruction *I);
 
   // Access to underlying machine instructions...
   typedef std::vector<MachineInstr*>::iterator iterator;