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;
}
}
return format("%" PRIx64 "h", Value);
}
}
+ llvm_unreachable("unsupported print style");
}
format_object1<uint64_t> MCInstPrinter::formatHex(const uint64_t Value) const {
else
return format("%" PRIx64 "h", Value);
}
+ llvm_unreachable("unsupported print style");
}