projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Const-correct and prevent a copy of a SmallPtrSet.
[oota-llvm.git]
/
lib
/
MC
/
MCInstPrinter.cpp
diff --git
a/lib/MC/MCInstPrinter.cpp
b/lib/MC/MCInstPrinter.cpp
index 6a452c8d4a7f50fd5ae42f31ea3f8cc4c4733b33..ba71245d0184fbb61d016bba313a998b0a57f17c 100644
(file)
--- a/
lib/MC/MCInstPrinter.cpp
+++ b/
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()) {
void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) {
if (!Annot.empty()) {
- if (CommentStream)
+ if (CommentStream)
{
(*CommentStream) << Annot;
(*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;
}
}
OS << " " << MAI.getCommentString() << " " << Annot;
}
}