allow attaching comments to raw text.
authorChris Lattner <sabre@nondot.org>
Sat, 3 Apr 2010 22:06:56 +0000 (22:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 3 Apr 2010 22:06:56 +0000 (22:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100292 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCAsmStreamer.cpp

index b92051791a0bd31196b1c96f006a8286c7913721..757eaddcf2d54a02a445308bbef3adaf668c16a4 100644 (file)
@@ -645,13 +645,10 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
 /// the specified string in the output .s file.  This capability is
 /// indicated by the hasRawTextSupport() predicate.
 void MCAsmStreamer::EmitRawText(StringRef String) {
-  if (!CommentToEmit.empty() || CommentStream.GetNumBytesInBuffer() != 0)
-    EmitCommentsAndEOL();
-  
+  if (!String.empty() && String.back() == '\n')
+    String = String.substr(0, String.size()-1);
   OS << String;
-  
-  if (!String.empty() && String.back() != '\n')
-    OS << '\n';
+  EmitEOL();
 }
 
 void MCAsmStreamer::Finish() {