Skip to content

Commit 11c8f1f

Browse files
committed
[Driver] Allow -fbasic-block-address-map for AArch64 ELF
Emitting the basic block address map with `-fbasic-block-sections=labels` is allowed for AArch64 ELF since 7eaf94f. Allow doing so with `-fbasic-block-address-map`.
1 parent d82e93e commit 11c8f1f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5959,7 +5959,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
59595959

59605960
if (Arg *A = Args.getLastArg(options::OPT_fbasic_block_address_map,
59615961
options::OPT_fno_basic_block_address_map)) {
5962-
if (Triple.isX86() && Triple.isOSBinFormatELF()) {
5962+
if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
59635963
if (A->getOption().matches(options::OPT_fbasic_block_address_map))
59645964
A->render(Args, CmdArgs);
59655965
} else {
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// RUN: %clang -### -target x86_64 -fbasic-block-address-map %s -S 2>&1 | FileCheck -check-prefix=CHECK-PRESENT %s
1+
// RUN: %clang -### --target=x86_64 -fbasic-block-address-map %s -S 2>&1 | FileCheck -check-prefix=CHECK-PRESENT %s
2+
// RUN: %clang -### --target=aarch64 -fbasic-block-address-map %s -S 2>&1 | FileCheck -check-prefix=CHECK-PRESENT %s
23
// CHECK-PRESENT: -fbasic-block-address-map
34

4-
// RUN: %clang -### -target x86_64 -fno-basic-block-address-map %s -S 2>&1 | FileCheck %s --check-prefix=CHECK-ABSENT
5+
// RUN: %clang -### --target=x86_64 -fno-basic-block-address-map %s -S 2>&1 | FileCheck %s --check-prefix=CHECK-ABSENT
56
// CHECK-ABSENT-NOT: -fbasic-block-address-map
67

7-
// RUN: not %clang -c -target x86_64-apple-darwin10 -fbasic-block-address-map %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
8+
// RUN: not %clang -c --target=x86_64-apple-darwin10 -fbasic-block-address-map %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
89
// CHECK-TRIPLE: error: unsupported option '-fbasic-block-address-map' for target

0 commit comments

Comments
 (0)