[llvm-commits] [llvm] r100292 - /llvm/trunk/lib/MC/MCAsmStreamer.cpp
Chris Lattner
sabre at nondot.org
Sat Apr 3 15:06:56 PDT 2010
Author: lattner
Date: Sat Apr 3 17:06:56 2010
New Revision: 100292
URL: http://llvm.org/viewvc/llvm-project?rev=100292&view=rev
Log:
allow attaching comments to raw text.
Modified:
llvm/trunk/lib/MC/MCAsmStreamer.cpp
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=100292&r1=100291&r2=100292&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Sat Apr 3 17:06:56 2010
@@ -645,13 +645,10 @@
/// 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() {
More information about the llvm-commits
mailing list