Skip to content

Commit 1f17c2d

Browse files
authored
[LLD] Deprecate --lto-basic-block-sections=labels (llvm#110697)
This option is now replaced by `--lto-basic-block-address-map`.
1 parent 02b9c97 commit 1f17c2d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lld/ELF/LTO.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,16 @@ static lto::Config createConfig(Ctx &ctx) {
6262
c.Options.DataSections = true;
6363

6464
// Check if basic block sections must be used.
65-
// Allowed values for --lto-basic-block-sections are "all", "labels",
65+
// Allowed values for --lto-basic-block-sections are "all",
6666
// "<file name specifying basic block ids>", or none. This is the equivalent
6767
// of -fbasic-block-sections= flag in clang.
6868
if (!ctx.arg.ltoBasicBlockSections.empty()) {
6969
if (ctx.arg.ltoBasicBlockSections == "all") {
7070
c.Options.BBSections = BasicBlockSection::All;
7171
} else if (ctx.arg.ltoBasicBlockSections == "labels") {
7272
c.Options.BBAddrMap = true;
73-
c.Options.BBSections = BasicBlockSection::None;
73+
warn("'--lto-basic-block-sections=labels' is deprecated; Please use "
74+
"'--lto-basic-block-address-map' instead");
7475
} else if (ctx.arg.ltoBasicBlockSections == "none") {
7576
c.Options.BBSections = BasicBlockSection::None;
7677
} else {

lld/test/ELF/lto/basic-block-sections.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
; REQUIRES: x86
22
; RUN: llvm-as %s -o %t.o
3+
; RUN: ld.lld %t.o -o %t --lto-basic-block-sections=labels --lto-O0 2>&1 | FileCheck -check-prefix=LABELSWARN %s
34
; RUN: ld.lld %t.o -o %t --lto-basic-block-sections=all --lto-O0 --save-temps
45
; RUN: llvm-readobj -s %t.lto.o | FileCheck --check-prefix=SECNAMES %s
56
; RUN: ld.lld %t.o -o %t --lto-basic-block-sections=all --lto-unique-basic-block-section-names --lto-O0 --save-temps
67
; RUN: llvm-readobj -s %t.lto.o | FileCheck --check-prefix=SECNAMES-FULL %s
78
; RUN: llvm-nm %t | FileCheck --check-prefix=SYMS %s
89

10+
; LABELSWARN: --lto-basic-block-sections=labels' is deprecated; Please use '--lto-basic-block-address-map' instead
11+
912
; SECNAMES: Name: .text.foo {{.*}}
1013
; SECNAMES: Name: .text.foo {{.*}}
1114
; SECNAMES: Name: .text.foo {{.*}}

0 commit comments

Comments
 (0)