add a gross hack to get "SrcLine" comments to show up with the
authorChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 20:45:42 +0000 (20:45 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 20:45:42 +0000 (20:45 +0000)
new asmprinter.  Differently gross hack coming next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81379 91177308-0d34-0410-b5e6-96231b3b80d8

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

index a6bd45b493b3419ba0eab055c654d2a3e2d5d5ab..9facf3bb5b54d40f46d94a736b911a9e50ab07ef 100644 (file)
@@ -132,13 +132,18 @@ public:
 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]; }
index e27c83b5ddbfbec40679f074c63b0e4ec22e23bf..fcab086644f568158e25d38b691547fce38bbaa3 100644 (file)
@@ -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: