// Get the default information for printing a comment.
StringRef CommentBegin = MAI.getCommentString();
unsigned CommentColumn = MAI.getCommentColumn();
- bool IsFirst = true;
+ ListSeparator LS("\n");
while (!Comments.empty()) {
- if (!IsFirst)
- FormattedOS << '\n';
+ FormattedOS << LS;
// Emit a line of comments.
FormattedOS.PadToColumn(CommentColumn);
size_t Position = Comments.find('\n');
FormattedOS << CommentBegin << ' ' << Comments.substr(0, Position);
// Move after the newline character.
Comments = Comments.substr(Position + 1);
- IsFirst = false;
}
FormattedOS.flush();
Entry.address() + BaseSegmentAddress);
outs() << Entry.name();
if (WeakDef || ThreadLocal || Resolver || Abs) {
- bool NeedsComma = false;
+ ListSeparator LS;
outs() << " [";
- if (WeakDef) {
- outs() << "weak_def";
- NeedsComma = true;
- }
- if (ThreadLocal) {
- if (NeedsComma)
- outs() << ", ";
- outs() << "per-thread";
- NeedsComma = true;
- }
- if (Abs) {
- if (NeedsComma)
- outs() << ", ";
- outs() << "absolute";
- NeedsComma = true;
- }
- if (Resolver) {
- if (NeedsComma)
- outs() << ", ";
- outs() << format("resolver=0x%08llX", Entry.other());
- NeedsComma = true;
- }
+ if (WeakDef)
+ outs() << LS << "weak_def";
+ if (ThreadLocal)
+ outs() << LS << "per-thread";
+ if (Abs)
+ outs() << LS << "absolute";
+ if (Resolver)
+ outs() << LS << format("resolver=0x%08llX", Entry.other());
outs() << "]";
}
if (ReExport) {