[llvm-commits] [llvm] r81379 - in /llvm/trunk: include/llvm/MC/MCInst.h lib/Target/X86/AsmPrinter/X86MCInstLower.cpp

Chris Lattner sabre at nondot.org
Wed Sep 9 13:45:42 PDT 2009


Author: lattner
Date: Wed Sep  9 15:45:42 2009
New Revision: 81379

URL: http://llvm.org/viewvc/llvm-project?rev=81379&view=rev
Log:
add a gross hack to get "SrcLine" comments to show up with the
new asmprinter.  Differently gross hack coming next.

Modified:
    llvm/trunk/include/llvm/MC/MCInst.h
    llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp

Modified: llvm/trunk/include/llvm/MC/MCInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInst.h?rev=81379&r1=81378&r2=81379&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/MCInst.h (original)
+++ llvm/trunk/include/llvm/MC/MCInst.h Wed Sep  9 15:45:42 2009
@@ -132,13 +132,18 @@
 class MCInst {
   unsigned Opcode;
   SmallVector<MCOperand, 8> 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]; }

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=81379&r1=81378&r2=81379&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed Sep  9 15:45:42 2009
@@ -267,6 +267,7 @@
 void X86ATTAsmPrinter::
 printInstructionThroughMCStreamer(const MachineInstr *MI) {
   MCInst TmpInst;
+  TmpInst.setDebugLoc(MI->getDebugLoc());
   switch (MI->getOpcode()) {
   case TargetInstrInfo::DBG_LABEL:
   case TargetInstrInfo::EH_LABEL:





More information about the llvm-commits mailing list