Skip to content

Commit

Permalink
allow attaching comments to raw text.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100292 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Apr 3, 2010
1 parent f94f8dc commit d5928dc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/MC/MCAsmStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d5928dc

Please sign in to comment.