// machine instructions:
//
// "Temporary values" are intermediate values used in the machine instruction
-// sequence, but not in the VM instruction Note that such values should be
+// sequence, but not in the VM instruction. Note that such values should be
// treated as pure SSA values with no interpretation of their operands (i.e., as
// a TmpInstruction object which actually represents such a value).
//
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineCodeForInstruction.h"
+#include "llvm/Function.h"
#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineInstrAnnot.h"
-#include "llvm/Instruction.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineFunctionInfo.h"
+#include "../Target/SparcV9/MachineInstrAnnot.h"
using namespace llvm;
-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!
+MachineCodeForInstruction &MachineCodeForInstruction::get(const Instruction *I){
+ MachineFunction &MF = MachineFunction::get(I->getParent()->getParent());
+ return MF.getInfo()->MCFIEntries[I];
+}
+void MachineCodeForInstruction::destroy(const Instruction *I) {
+ MachineFunction &MF = MachineFunction::get(I->getParent()->getParent());
+ MF.getInfo()->MCFIEntries.erase(I);
}
-
-// Register the annotation with the annotation factory
-static struct MCFIInitializer {
- MCFIInitializer() {
- AnnotationManager::registerAnnotationFactory(MCFI_AID, &CreateMCFI);
- }
-} RegisterCreateMCFI;
-
void
MachineCodeForInstruction::dropAllReferences()