Skip to content

Commit 07316bf

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 f1bb88b commit 07316bf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

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

59595959
if (Arg *A = Args.getLastArg(options::OPT_fbasic_block_address_map,
59605960
options::OPT_fno_basic_block_address_map)) {
5961-
if (Triple.isX86() && Triple.isOSBinFormatELF()) {
5961+
if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
59625962
if (A->getOption().matches(options::OPT_fbasic_block_address_map))
59635963
A->render(Args, CmdArgs);
59645964
} else {

clang/test/Driver/basic-block-address-map.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// 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

45
// RUN: %clang -### -target x86_64 -fno-basic-block-address-map %s -S 2>&1 | FileCheck %s --check-prefix=CHECK-ABSENT

0 commit comments

Comments
 (0)