From 51a8d8528135ba4e3e4cf7cd711a9e47b19078a3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 28 Oct 2002 01:21:55 +0000 Subject: Inline some methods from .cpp files into .h files, minor cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4313 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineCodeForInstruction.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/llvm/CodeGen/MachineCodeForInstruction.h') 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 tempVec; // used by m/c instr but not VM instr std::vector 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::iterator iterator; -- cgit v1.2.3-18-g5258