diff --git a/llvm/include/llvm/MC/MCInst.h b/llvm/include/llvm/MC/MCInst.h index a6bd45b493b3..9facf3bb5b54 100644 --- a/llvm/include/llvm/MC/MCInst.h +++ b/llvm/include/llvm/MC/MCInst.h @@ -132,13 +132,18 @@ public: class MCInst { unsigned Opcode; SmallVector Operands; + + // FIXME: This is a hack! + DebugLoc Loc; public: MCInst() : Opcode(~0U) {} void setOpcode(unsigned Op) { Opcode = Op; } unsigned getOpcode() const { return Opcode; } - DebugLoc getDebugLoc() const { return DebugLoc(); } + + void setDebugLoc(DebugLoc L) { Loc = L; } + DebugLoc getDebugLoc() const { return Loc; } const MCOperand &getOperand(unsigned i) const { return Operands[i]; } MCOperand &getOperand(unsigned i) { return Operands[i]; } diff --git a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp index e27c83b5ddbf..fcab086644f5 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp @@ -267,6 +267,7 @@ MCOperand X86ATTAsmPrinter::LowerSymbolOperand(const MachineOperand &MO, void X86ATTAsmPrinter:: printInstructionThroughMCStreamer(const MachineInstr *MI) { MCInst TmpInst; + TmpInst.setDebugLoc(MI->getDebugLoc()); switch (MI->getOpcode()) { case TargetInstrInfo::DBG_LABEL: case TargetInstrInfo::EH_LABEL: