Skip to content

Commit 62e7ef1

Browse files
author
Alex B
committed
Address Feedback Nr.2
1 parent 95d49c6 commit 62e7ef1

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

lld/MachO/MapFile.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ void macho::writeMapFile() {
234234
os << "# Address\tSize \tFile Name\n";
235235
for (const OutputSegment *seg : outputSegments) {
236236
for (const OutputSection *osec : seg->getSections()) {
237-
const TextOutputSection *textOsec = dyn_cast<TextOutputSection>(osec);
238-
if (textOsec && textOsec->getThunks().size()) {
237+
if (auto *textOsec = dyn_cast<TextOutputSection>(osec)) {
239238
auto inputsAndThunks =
240239
mergeOrderedInputs(textOsec->inputs, textOsec->getThunks());
241240
printIsecArrSyms(inputsAndThunks);

lld/test/MachO/arm64-thunks.s

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,34 @@
1818
# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t/thunk | FileCheck %s
1919

2020
## Check that the thunks appear in the map file and that everything is sorted by address
21-
# Because of the `.space` instructions, there will end up being a lot of dead symbols in the linker map
22-
# so generate a version of the linker map without dead symbols.
21+
# Because of the `.space` instructions, there will end up being a lot of dead symbols in the
22+
# linker map (linker map will be ~2.7GB). So to avoid the test trying to (slowly) match regex
23+
# across all the ~2.7GB of the linker map - generate a version of the linker map without dead symbols.
2324
# RUN: awk '/# Dead Stripped Symbols:/ {exit} {print}' %t/thunk.map > %t/thunk_no_dead_syms.map
2425

2526
# RUN: FileCheck %s --input-file %t/thunk_no_dead_syms.map --check-prefix=MAP
2627

27-
# MAP: [[ADDR1:0x[0-9A-Fa-f]+]] {{.*}} _b
28-
# MAP-NEXT: [[ADDR2:0x[0-9A-Fa-f]+]] {{.*}} _c
29-
# MAP-NEXT: [[ADDR3:0x[0-9A-Fa-f]+]] {{.*}} _d.thunk.0
30-
# MAP-NEXT: [[ADDR4:0x[0-9A-Fa-f]+]] {{.*}} _e.thunk.0
31-
# MAP-NEXT: [[ADDR5:0x[0-9A-Fa-f]+]] {{.*}} _f.thunk.0
32-
# MAP-NEXT: [[ADDR6:0x[0-9A-Fa-f]+]] {{.*}} _g.thunk.0
33-
# MAP-NEXT: [[ADDR7:0x[0-9A-Fa-f]+]] {{.*}} _h.thunk.0
34-
# MAP-NEXT: [[ADDR8:0x[0-9A-Fa-f]+]] {{.*}} ___nan.thunk.0
35-
# MAP-NEXT: [[ADDR9:0x[0-9A-Fa-f]+]] {{.*}} _d
36-
# MAP-NEXT: [[ADDR10:0x[0-9A-Fa-f]+]] {{.*}} _e
37-
# MAP-NEXT: [[ADDR11:0x[0-9A-Fa-f]+]] {{.*}} _f
38-
# MAP-NEXT: [[ADDR12:0x[0-9A-Fa-f]+]] {{.*}} _g
39-
# MAP-NEXT: [[ADDR13:0x[0-9A-Fa-f]+]] {{.*}} _a.thunk.0
40-
# MAP-NEXT: [[ADDR14:0x[0-9A-Fa-f]+]] {{.*}} _b.thunk.0
41-
# MAP-NEXT: [[ADDR15:0x[0-9A-Fa-f]+]] {{.*}} _h
42-
# MAP-NEXT: [[ADDR16:0x[0-9A-Fa-f]+]] {{.*}} _main
43-
# MAP-NEXT: [[ADDR17:0x[0-9A-Fa-f]+]] {{.*}} _c.thunk.0
44-
# MAP-NEXT: [[ADDR18:0x[0-9A-Fa-f]+]] {{.*}} _d.thunk.1
45-
# MAP-NEXT: [[ADDR19:0x[0-9A-Fa-f]+]] {{.*}} _e.thunk.1
46-
# MAP-NEXT: [[ADDR20:0x[0-9A-Fa-f]+]] {{.*}} _f.thunk.1
47-
# MAP-NEXT: [[ADDR21:0x[0-9A-Fa-f]+]] {{.*}} _z
28+
# MAP: 0x{{[[:xdigit:]]+}} {{.*}} _b
29+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _c
30+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _d.thunk.0
31+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _e.thunk.0
32+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _f.thunk.0
33+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _g.thunk.0
34+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _h.thunk.0
35+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} ___nan.thunk.0
36+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _d
37+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _e
38+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _f
39+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _g
40+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _a.thunk.0
41+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _b.thunk.0
42+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _h
43+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _main
44+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _c.thunk.0
45+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _d.thunk.1
46+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _e.thunk.1
47+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _f.thunk.1
48+
# MAP-NEXT: 0x{{[[:xdigit:]]+}} {{.*}} _z
4849

4950

5051
# CHECK: Disassembly of section __TEXT,__text:

0 commit comments

Comments
 (0)