summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2013-10-01 19:21:24 +0000
committerQuentin Colombet <qcolombet@apple.com>2013-10-01 19:21:24 +0000
commit85f60ef6333fd25b9c50802e1ab60cf70d33bf91 (patch)
tree4a320d5e5958563097b0f914c941baab8cbed2f2 /llvm/lib
parent517d84e268fb90ca98cd765fc1699cd81f7d5f28 (diff)
downloadbcm5719-llvm-85f60ef6333fd25b9c50802e1ab60cf70d33bf91.tar.gz
bcm5719-llvm-85f60ef6333fd25b9c50802e1ab60cf70d33bf91.zip
[MC] When MCInstPrint::printAnnotation uses a comment stream, it has to ensure
that each comment ends with a newline to match the definition in the header file. This is part of <rdar://problem/14687488>. llvm-svn: 191787
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCInstPrinter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCInstPrinter.cpp b/llvm/lib/MC/MCInstPrinter.cpp
index 6a452c8d4a7..ba71245d018 100644
--- a/llvm/lib/MC/MCInstPrinter.cpp
+++ b/llvm/lib/MC/MCInstPrinter.cpp
@@ -31,9 +31,13 @@ void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) {
if (!Annot.empty()) {
- if (CommentStream)
+ if (CommentStream) {
(*CommentStream) << Annot;
- else
+ // By definition (see MCInstPrinter.h), CommentStream must end with
+ // a newline after each comment.
+ if (Annot.back() != '\n')
+ (*CommentStream) << '\n';
+ } else
OS << " " << MAI.getCommentString() << " " << Annot;
}
}
OpenPOWER on IntegriCloud