Move CallArgsDescriptor into this class instead of making it an
authorVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 29 Oct 2002 19:38:46 +0000 (19:38 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 29 Oct 2002 19:38:46 +0000 (19:38 +0000)
annotation on the machine instruction.

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

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

index 2193a80e529bcc477e7654773b649e58e61124a1..f4ec42dbf3d0b8b520ac39cabd89d1b96e3f4368 100644 (file)
 class MachineInstr;
 class Instruction;
 class Value;
+class CallArgsDescriptor;
 
 extern AnnotationID MCFI_AID;
 
 class MachineCodeForInstruction : public Annotation {
-  std::vector<Value*> tempVec;         // used by m/c instr but not VM instr
-  std::vector<MachineInstr*> Contents;
+  std::vector<Value*> tempVec;          // used by m/c instr but not VM instr
+  std::vector<MachineInstr*> Contents;  // the machine instr for this VM instr
+  CallArgsDescriptor* callArgsDesc;     // only used for CALL instructions
 public:
   MachineCodeForInstruction() : Annotation(MCFI_AID) {}
   ~MachineCodeForInstruction();
@@ -81,6 +83,9 @@ public:
     tempVec.push_back(tmp);
     return *this;
   }
+
+  void setCallArgsDescriptor(CallArgsDescriptor* desc) { callArgsDesc = desc; }
+  CallArgsDescriptor* getCallArgsDescriptor() const    { return callArgsDesc; }
 };
 
 #endif
index f3080628ee83906141ea961c99d381510e35e2fa..7b2fb75c653bba751619f5ff51fa7ae682a5812e 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/MachineInstrAnnot.h"
 #include "llvm/CodeGen/InstrSelection.h"
 
 AnnotationID MCFI_AID(
@@ -55,4 +56,8 @@ MachineCodeForInstruction::~MachineCodeForInstruction()
   // Free the MachineInstr objects allocated, if any.
   for (unsigned i=0, N = size(); i < N; i++)
     delete (*this)[i];
+
+  // Free the CallArgsDescriptor if it exists.
+  if (callArgsDesc)
+    delete callArgsDesc;
 }
index 2193a80e529bcc477e7654773b649e58e61124a1..f4ec42dbf3d0b8b520ac39cabd89d1b96e3f4368 100644 (file)
 class MachineInstr;
 class Instruction;
 class Value;
+class CallArgsDescriptor;
 
 extern AnnotationID MCFI_AID;
 
 class MachineCodeForInstruction : public Annotation {
-  std::vector<Value*> tempVec;         // used by m/c instr but not VM instr
-  std::vector<MachineInstr*> Contents;
+  std::vector<Value*> tempVec;          // used by m/c instr but not VM instr
+  std::vector<MachineInstr*> Contents;  // the machine instr for this VM instr
+  CallArgsDescriptor* callArgsDesc;     // only used for CALL instructions
 public:
   MachineCodeForInstruction() : Annotation(MCFI_AID) {}
   ~MachineCodeForInstruction();
@@ -81,6 +83,9 @@ public:
     tempVec.push_back(tmp);
     return *this;
   }
+
+  void setCallArgsDescriptor(CallArgsDescriptor* desc) { callArgsDesc = desc; }
+  CallArgsDescriptor* getCallArgsDescriptor() const    { return callArgsDesc; }
 };
 
 #endif