diff options
Diffstat (limited to 'lib/CodeGen/MachineCodeForInstruction.cpp')
-rw-r--r-- | lib/CodeGen/MachineCodeForInstruction.cpp | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/lib/CodeGen/MachineCodeForInstruction.cpp b/lib/CodeGen/MachineCodeForInstruction.cpp index d6094cef40..c50c8b8c6a 100644 --- a/lib/CodeGen/MachineCodeForInstruction.cpp +++ b/lib/CodeGen/MachineCodeForInstruction.cpp @@ -23,36 +23,22 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachineCodeForInstruction.h" +#include "llvm/Function.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFunctionInfo.h" #include "../Target/SparcV9/MachineInstrAnnot.h" -#include "llvm/Instruction.h" using namespace llvm; MachineCodeForInstruction &MachineCodeForInstruction::get(const Instruction *I){ - return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID); + MachineFunction &MF = MachineFunction::get(I->getParent()->getParent()); + return MF.getInfo()->MCFIEntries[I]; } void MachineCodeForInstruction::destroy(const Instruction *I) { - I->deleteAnnotation(MCFI_AID); + MachineFunction &MF = MachineFunction::get(I->getParent()->getParent()); + MF.getInfo()->MCFIEntries.erase(I); } - - -AnnotationID llvm::MCFI_AID( - AnnotationManager::getID("CodeGen::MachineCodeForInstruction")); - -static Annotation *CreateMCFI(AnnotationID AID, const Annotable *, void *) { - assert(AID == MCFI_AID); - return new MachineCodeForInstruction(); // Invoke constructor! -} - -// Register the annotation with the annotation factory -static struct MCFIInitializer { - MCFIInitializer() { - AnnotationManager::registerAnnotationFactory(MCFI_AID, &CreateMCFI); - } -} RegisterCreateMCFI; - - void MachineCodeForInstruction::dropAllReferences() { |