- Move TargetLowering::EmitTargetCodeForFrameDebugValue to TargetInstrInfo and rename...
[oota-llvm.git] / lib / Target / X86 / X86InstrInfo.cpp
index 1192a471bd724914f1f87d8729009b00fe593727..ebcd8cc535c006367597f90498b5239b9bb926ba 100644 (file)
@@ -2319,6 +2319,20 @@ bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
   return true;
 }
 
+MachineInstr*
+X86InstrInfo::emitFrameIndexDebugValue(MachineFunction &MF,
+                                       unsigned FrameIx, uint64_t Offset,
+                                       const MDNode *MDPtr,
+                                       DebugLoc DL) const {
+  // Target dependent DBG_VALUE.  Only the frame index case is done here.
+  X86AddressMode AM;
+  AM.BaseType = X86AddressMode::FrameIndexBase;
+  AM.Base.FrameIndex = FrameIx;
+  MachineInstrBuilder MIB = BuildMI(MF, DL, get(X86::DBG_VALUE));
+  addFullAddress(MIB, AM).addImm(Offset).addMetadata(MDPtr);
+  return &*MIB;
+}
+
 static MachineInstr *FuseTwoAddrInst(MachineFunction &MF, unsigned Opcode,
                                      const SmallVectorImpl<MachineOperand> &MOs,
                                      MachineInstr *MI,