Skip to content

Commit 2661d59

Browse files
committed
MC: Remove post-relaxation and Symbol printing from mc-dump output
The "Symbol" stanza includes symbol names with all zero indexes. which are not useful. The "assembler backend - post-relaxation" part is not useful. Only Hexagon (and X86 when x86-pad-for-align is set) might change the layout between "post-relaxation" and "final-layout". From my experience debugging the two passes requires more dumping code not served by the output.
1 parent 279e808 commit 2661d59

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

llvm/lib/MC/MCAssembler.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,6 @@ void MCAssembler::layout() {
848848
if (getContext().hadError())
849849
return;
850850

851-
DEBUG_WITH_TYPE("mc-dump", {
852-
errs() << "assembler backend - post-relaxation\n--\n";
853-
dump(); });
854-
855851
// Some targets might want to adjust fragment offsets. If so, perform another
856852
// layout iteration.
857853
if (getBackend().finishLayout(*this))
@@ -1275,25 +1271,10 @@ LLVM_DUMP_METHOD void MCAssembler::dump() const{
12751271
raw_ostream &OS = errs();
12761272

12771273
OS << "Sections:[";
1278-
bool First = true;
12791274
for (const MCSection &Sec : *this) {
12801275
OS << '\n';
12811276
Sec.dump();
12821277
}
12831278
OS << "\n]\n";
1284-
OS << "Symbols:[\n";
1285-
1286-
First = true;
1287-
for (const MCSymbol &Sym : symbols()) {
1288-
if (First)
1289-
First = false;
1290-
else
1291-
OS << "\n";
1292-
OS << "(";
1293-
Sym.dump();
1294-
OS << ", Index:" << Sym.getIndex() << ", ";
1295-
OS << ")";
1296-
}
1297-
OS << "\n]\n";
12981279
}
12991280
#endif

llvm/test/MC/ELF/mc-dump.s

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
# CHECK-NEXT:4 Fill Value:0 ValueSize:1 NumValues:1
2323
# CHECK-NEXT:5 LEB Value:.Ltmp1-.Ltmp0 Signed:0
2424
# CHECK-NEXT:]
25-
# CHECK-NEXT:Symbols:[
26-
# CHECK-NEXT:(.text, Index:0, )
27-
# CHECK-NEXT:(.Ltmp0, Index:0, )
2825

2926
0:
3027
.org 3

0 commit comments

Comments
 (0)