Skip to content

Commit c062fa6

Browse files
authored
Revert "[LLD][COFF] Display the size of all consumed inputs with /summary" (#157282)
Reverts #157279
1 parent 1c0ca8a commit c062fa6

File tree

7 files changed

+38
-49
lines changed

7 files changed

+38
-49
lines changed

lld/COFF/COFFLinkerContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class COFFLinkerContext : public CommonLinkerContext {
6161
std::vector<ObjFile *> objFileInstances;
6262
std::map<std::string, PDBInputFile *> pdbInputFileInstances;
6363
std::vector<ImportFile *> importFileInstances;
64-
std::int64_t consumedInputsSize = 0;
6564

6665
MergeChunk *mergeChunkInstances[Log2MaxSectionAlignment + 1] = {};
6766

lld/COFF/Driver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ void LinkerDriver::addFile(InputFile *file) {
205205
else
206206
cast<ObjFile>(file)->parseLazy();
207207
} else {
208-
ctx.consumedInputsSize += file->mb.getBufferSize();
209208
file->parse();
210209
if (auto *f = dyn_cast<ObjFile>(file)) {
211210
ctx.objFileInstances.push_back(f);

lld/COFF/PDB.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "llvm/Object/CVDebugRecord.h"
4545
#include "llvm/Support/CRC.h"
4646
#include "llvm/Support/Endian.h"
47-
#include "llvm/Support/FormatAdapters.h"
4847
#include "llvm/Support/FormatVariadic.h"
4948
#include "llvm/Support/Path.h"
5049
#include "llvm/Support/ScopedPrinter.h"
@@ -1248,19 +1247,15 @@ void PDBLinker::printStats() {
12481247
<< std::string(80, '-') << '\n';
12491248

12501249
auto print = [&](uint64_t v, StringRef s) {
1251-
stream << formatv("{0}",
1252-
fmt_align(formatv("{0:N}", v), AlignStyle::Right, 20))
1253-
<< " " << s << '\n';
1250+
stream << format_decimal(v, 15) << " " << s << '\n';
12541251
};
12551252

12561253
print(ctx.objFileInstances.size(),
12571254
"Input OBJ files (expanded from all cmd-line inputs)");
1258-
print(ctx.consumedInputsSize,
1259-
"Size of all consumed OBJ files (non-lazy), in bytes");
12601255
print(ctx.typeServerSourceMappings.size(), "PDB type server dependencies");
12611256
print(ctx.precompSourceMappings.size(), "Precomp OBJ dependencies");
12621257
print(nbTypeRecords, "Input type records");
1263-
print(nbTypeRecordsBytes, "Size of all input type records, in bytes");
1258+
print(nbTypeRecordsBytes, "Input type records bytes");
12641259
print(builder.getTpiBuilder().getRecordCount(), "Merged TPI records");
12651260
print(builder.getIpiBuilder().getRecordCount(), "Merged IPI records");
12661261
print(pdbStrTab.size(), "Output PDB strings");

lld/test/COFF/pdb-type-server-simple.test

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,17 @@ CHECK-LABEL: Mod 0002 | `* Linker *`:
106106

107107
SUMMARY: Summary
108108
SUMMARY-NEXT: --------------------------------------------------------------------------------
109-
SUMMARY-NEXT: 2 Input OBJ files (expanded from all cmd-line inputs)
110-
SUMMARY-NEXT: Size of all consumed OBJ files (non-lazy), in bytes
111-
SUMMARY-NEXT: 1 PDB type server dependencies
112-
SUMMARY-NEXT: 0 Precomp OBJ dependencies
113-
SUMMARY-NEXT: 25 Input type records
114-
SUMMARY-NEXT: 868 Size of all input type records, in bytes
115-
SUMMARY-NEXT: 9 Merged TPI records
116-
SUMMARY-NEXT: 16 Merged IPI records
117-
SUMMARY-NEXT: 3 Output PDB strings
118-
SUMMARY-NEXT: 4 Global symbol records
119-
SUMMARY-NEXT: 14 Module symbol records
120-
SUMMARY-NEXT: 2 Public symbol records
109+
SUMMARY-NEXT: 2 Input OBJ files (expanded from all cmd-line inputs)
110+
SUMMARY-NEXT: 1 PDB type server dependencies
111+
SUMMARY-NEXT: 0 Precomp OBJ dependencies
112+
SUMMARY-NEXT: 25 Input type records
113+
SUMMARY-NEXT: 868 Input type records bytes
114+
SUMMARY-NEXT: 9 Merged TPI records
115+
SUMMARY-NEXT: 16 Merged IPI records
116+
SUMMARY-NEXT: 3 Output PDB strings
117+
SUMMARY-NEXT: 4 Global symbol records
118+
SUMMARY-NEXT: 14 Module symbol records
119+
SUMMARY-NEXT: 2 Public symbol records
121120

122121
SUMMARY: Top 10 types responsible for the most TPI input:
123122
SUMMARY-NEXT: index total bytes count size

lld/test/COFF/precomp-link-samename.test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ CHECK-NOT: LF_ENDPRECOMP
1212

1313
SUMMARY: Summary
1414
SUMMARY-NEXT: --------------------------------------------------------------------------------
15-
SUMMARY-NEXT: 4 Input OBJ files (expanded from all cmd-line inputs)
16-
SUMMARY-NEXT: Size of all consumed OBJ files (non-lazy), in bytes
17-
SUMMARY-NEXT: 0 PDB type server dependencies
18-
SUMMARY-NEXT: 2 Precomp OBJ dependencies
15+
SUMMARY-NEXT: 4 Input OBJ files (expanded from all cmd-line inputs)
16+
SUMMARY-NEXT: 0 PDB type server dependencies
17+
SUMMARY-NEXT: 2 Precomp OBJ dependencies
1918

2019
// precompa/precomp.cpp
2120
#include "precomp.h"

lld/test/COFF/precomp-link.test

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,17 @@ CHECK-NOT: LF_ENDPRECOMP
5959

6060
SUMMARY: Summary
6161
SUMMARY-NEXT: --------------------------------------------------------------------------------
62-
SUMMARY-NEXT: 3 Input OBJ files (expanded from all cmd-line inputs)
63-
SUMMARY-NEXT: Size of all consumed OBJ files (non-lazy), in bytes
64-
SUMMARY-NEXT: 0 PDB type server dependencies
65-
SUMMARY-NEXT: 1 Precomp OBJ dependencies
66-
SUMMARY-NEXT: 1,066 Input type records
67-
SUMMARY-NEXT: 55,968 Size of all input type records, in bytes
68-
SUMMARY-NEXT: 874 Merged TPI records
69-
SUMMARY-NEXT: 170 Merged IPI records
70-
SUMMARY-NEXT: 5 Output PDB strings
71-
SUMMARY-NEXT: 167 Global symbol records
72-
SUMMARY-NEXT: 20 Module symbol records
73-
SUMMARY-NEXT: 3 Public symbol records
62+
SUMMARY-NEXT: 3 Input OBJ files (expanded from all cmd-line inputs)
63+
SUMMARY-NEXT: 0 PDB type server dependencies
64+
SUMMARY-NEXT: 1 Precomp OBJ dependencies
65+
SUMMARY-NEXT: 1066 Input type records
66+
SUMMARY-NEXT: 55968 Input type records bytes
67+
SUMMARY-NEXT: 874 Merged TPI records
68+
SUMMARY-NEXT: 170 Merged IPI records
69+
SUMMARY-NEXT: 5 Output PDB strings
70+
SUMMARY-NEXT: 167 Global symbol records
71+
SUMMARY-NEXT: 20 Module symbol records
72+
SUMMARY-NEXT: 3 Public symbol records
7473

7574
// precomp.h
7675
#pragma once

lld/test/COFF/precomp-summary-fail.test

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ RUN: /dll /out:%t.dll /debug /summary | FileCheck %s -check-prefix SUMMARY
1111

1212
SUMMARY: Summary
1313
SUMMARY-NEXT: --------------------------------------------------------------------------------
14-
SUMMARY-NEXT: 2 Input OBJ files (expanded from all cmd-line inputs)
15-
SUMMARY-NEXT: Size of all consumed OBJ files (non-lazy), in bytes
16-
SUMMARY-NEXT: 0 PDB type server dependencies
17-
SUMMARY-NEXT: 1 Precomp OBJ dependencies
18-
SUMMARY-NEXT: 8 Input type records
19-
SUMMARY-NEXT: 232 Size of all input type records, in bytes
20-
SUMMARY-NEXT: 3 Merged TPI records
21-
SUMMARY-NEXT: 2 Merged IPI records
22-
SUMMARY-NEXT: 1 Output PDB strings
23-
SUMMARY-NEXT: 0 Global symbol records
24-
SUMMARY-NEXT: 4 Module symbol records
25-
SUMMARY-NEXT: 0 Public symbol records
14+
SUMMARY-NEXT: 2 Input OBJ files (expanded from all cmd-line inputs)
15+
SUMMARY-NEXT: 0 PDB type server dependencies
16+
SUMMARY-NEXT: 1 Precomp OBJ dependencies
17+
SUMMARY-NEXT: 8 Input type records
18+
SUMMARY-NEXT: 232 Input type records bytes
19+
SUMMARY-NEXT: 3 Merged TPI records
20+
SUMMARY-NEXT: 2 Merged IPI records
21+
SUMMARY-NEXT: 1 Output PDB strings
22+
SUMMARY-NEXT: 0 Global symbol records
23+
SUMMARY-NEXT: 4 Module symbol records
24+
SUMMARY-NEXT: 0 Public symbol records

0 commit comments

Comments
 (0)