forked from OSchip/llvm-project
[objdump] Use ListSeparator (NFC)
This commit is contained in:
parent
31443f8e86
commit
3e8be5ab87
|
@ -7160,17 +7160,15 @@ static void emitComments(raw_svector_ostream &CommentStream,
|
||||||
// Get the default information for printing a comment.
|
// Get the default information for printing a comment.
|
||||||
StringRef CommentBegin = MAI.getCommentString();
|
StringRef CommentBegin = MAI.getCommentString();
|
||||||
unsigned CommentColumn = MAI.getCommentColumn();
|
unsigned CommentColumn = MAI.getCommentColumn();
|
||||||
bool IsFirst = true;
|
ListSeparator LS("\n");
|
||||||
while (!Comments.empty()) {
|
while (!Comments.empty()) {
|
||||||
if (!IsFirst)
|
FormattedOS << LS;
|
||||||
FormattedOS << '\n';
|
|
||||||
// Emit a line of comments.
|
// Emit a line of comments.
|
||||||
FormattedOS.PadToColumn(CommentColumn);
|
FormattedOS.PadToColumn(CommentColumn);
|
||||||
size_t Position = Comments.find('\n');
|
size_t Position = Comments.find('\n');
|
||||||
FormattedOS << CommentBegin << ' ' << Comments.substr(0, Position);
|
FormattedOS << CommentBegin << ' ' << Comments.substr(0, Position);
|
||||||
// Move after the newline character.
|
// Move after the newline character.
|
||||||
Comments = Comments.substr(Position + 1);
|
Comments = Comments.substr(Position + 1);
|
||||||
IsFirst = false;
|
|
||||||
}
|
}
|
||||||
FormattedOS.flush();
|
FormattedOS.flush();
|
||||||
|
|
||||||
|
@ -10296,30 +10294,16 @@ static void printMachOExportsTrie(const object::MachOObjectFile *Obj) {
|
||||||
Entry.address() + BaseSegmentAddress);
|
Entry.address() + BaseSegmentAddress);
|
||||||
outs() << Entry.name();
|
outs() << Entry.name();
|
||||||
if (WeakDef || ThreadLocal || Resolver || Abs) {
|
if (WeakDef || ThreadLocal || Resolver || Abs) {
|
||||||
bool NeedsComma = false;
|
ListSeparator LS;
|
||||||
outs() << " [";
|
outs() << " [";
|
||||||
if (WeakDef) {
|
if (WeakDef)
|
||||||
outs() << "weak_def";
|
outs() << LS << "weak_def";
|
||||||
NeedsComma = true;
|
if (ThreadLocal)
|
||||||
}
|
outs() << LS << "per-thread";
|
||||||
if (ThreadLocal) {
|
if (Abs)
|
||||||
if (NeedsComma)
|
outs() << LS << "absolute";
|
||||||
outs() << ", ";
|
if (Resolver)
|
||||||
outs() << "per-thread";
|
outs() << LS << format("resolver=0x%08llX", Entry.other());
|
||||||
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;
|
|
||||||
}
|
|
||||||
outs() << "]";
|
outs() << "]";
|
||||||
}
|
}
|
||||||
if (ReExport) {
|
if (ReExport) {
|
||||||
|
|
Loading…
Reference in New Issue