summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineCodeForInstruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/MachineCodeForInstruction.h')
-rw-r--r--include/llvm/CodeGen/MachineCodeForInstruction.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineCodeForInstruction.h b/include/llvm/CodeGen/MachineCodeForInstruction.h
index 050a626c2b..aa6ddd55ca 100644
--- a/include/llvm/CodeGen/MachineCodeForInstruction.h
+++ b/include/llvm/CodeGen/MachineCodeForInstruction.h
@@ -24,15 +24,22 @@ class MachineInstr;
class Instruction;
class Value;
+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;
public:
- MachineCodeForInstruction();
+ MachineCodeForInstruction() : Annotation(MCFI_AID) {}
~MachineCodeForInstruction();
- static MachineCodeForInstruction &get(const Instruction *I);
- static void destroy(const Instruction *I);
+ static MachineCodeForInstruction &get(const Instruction *I) {
+ assert(I != NULL);
+ return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID);
+ }
+ static void destroy(const Instruction *I) {
+ I->deleteAnnotation(MCFI_AID);
+ }
// Access to underlying machine instructions...
typedef std::vector<MachineInstr*>::iterator iterator;