TargetInstrInfo::hasOperandInterlock() is always true, because it is
[oota-llvm.git] / lib / CodeGen / MachineCodeForInstruction.cpp
index 9d63df5bf85874a84e9a4966f28f15d83fc8da33..c50c8b8c6aef55a7c76ea6f42628c492d61ac6f7 100644 (file)
@@ -13,7 +13,7 @@
 // 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()