Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter...
authorDevang Patel <dpatel@apple.com>
Fri, 29 Apr 2011 18:00:54 +0000 (18:00 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 29 Apr 2011 18:00:54 +0000 (18:00 +0000)
PR 9810

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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/MC/MCAsmStreamer.cpp

index 549bdcb6687a5a55edda498ddba5096a80ed05ce..8116f8d5925f457fc027d2ba8f12b20ecaa6c207 100644 (file)
@@ -691,6 +691,9 @@ void AsmPrinter::EmitFunctionBody() {
         if (isVerbose()) EmitKill(II, *this);
         break;
       default:
+        if (!TM.hasMCUseLoc())
+          MCLineEntry::Make(&OutStreamer, getCurrentSection());
+
         EmitInstruction(II);
         break;
       }
index 2f8297725e7b52f5ce486fb64b24f76b55f0fbc6..23ddebd3cfdc9f2032052b1a37d98235280d5774 100644 (file)
@@ -957,9 +957,6 @@ void MCAsmStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
 void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
   assert(getCurrentSection() && "Cannot emit contents before setting section!");
 
-  if (!UseLoc)
-    MCLineEntry::Make(this, getCurrentSection());
-
   // Show the encoding in a comment if we have a code emitter.
   if (Emitter)
     AddEncodingComment(Inst);