Skip to content

Commit ca72e26

Browse files
Merge branch 'main' into format-decay-array
2 parents e051073 + 53c0a25 commit ca72e26

File tree

1,578 files changed

+81758
-34890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,578 files changed

+81758
-34890
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ concurrency:
3333
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
3434
cancel-in-progress: true
3535

36-
37-
env:
38-
# LLVM POST-BRANCH bump version
39-
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
40-
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
41-
LLVM_HEAD_VERSION: "19" # Used compiler, update POST-BRANCH.
42-
LLVM_PREVIOUS_VERSION: "18"
43-
LLVM_OLDEST_VERSION: "17"
44-
GCC_STABLE_VERSION: "13"
45-
LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-19"
46-
CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
47-
4836
jobs:
4937
stage1:
5038
if: github.repository_owner == 'llvm'

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,19 @@ inline raw_ostream &operator<<(raw_ostream &OS,
24072407
return OS;
24082408
}
24092409

2410+
/// Compare function by index if it is valid, fall back to the original address
2411+
/// otherwise.
2412+
inline bool compareBinaryFunctionByIndex(const BinaryFunction *A,
2413+
const BinaryFunction *B) {
2414+
if (A->hasValidIndex() && B->hasValidIndex())
2415+
return A->getIndex() < B->getIndex();
2416+
if (A->hasValidIndex() && !B->hasValidIndex())
2417+
return true;
2418+
if (!A->hasValidIndex() && B->hasValidIndex())
2419+
return false;
2420+
return A->getAddress() < B->getAddress();
2421+
}
2422+
24102423
} // namespace bolt
24112424

24122425
// GraphTraits specializations for function basic block graphs (CFGs)

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,13 +1607,7 @@ std::vector<BinaryFunction *> BinaryContext::getSortedFunctions() {
16071607
SortedFunctions.begin(),
16081608
[](BinaryFunction &BF) { return &BF; });
16091609

1610-
llvm::stable_sort(SortedFunctions,
1611-
[](const BinaryFunction *A, const BinaryFunction *B) {
1612-
if (A->hasValidIndex() && B->hasValidIndex()) {
1613-
return A->getIndex() < B->getIndex();
1614-
}
1615-
return A->hasValidIndex();
1616-
});
1610+
llvm::stable_sort(SortedFunctions, compareBinaryFunctionByIndex);
16171611
return SortedFunctions;
16181612
}
16191613

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,7 @@ bool BinaryFunction::isForwardCall(const MCSymbol *CalleeSymbol) const {
385385
if (CalleeBF) {
386386
if (CalleeBF->isInjected())
387387
return true;
388-
389-
if (hasValidIndex() && CalleeBF->hasValidIndex()) {
390-
return getIndex() < CalleeBF->getIndex();
391-
} else if (hasValidIndex() && !CalleeBF->hasValidIndex()) {
392-
return true;
393-
} else if (!hasValidIndex() && CalleeBF->hasValidIndex()) {
394-
return false;
395-
} else {
396-
return getAddress() < CalleeBF->getAddress();
397-
}
388+
return compareBinaryFunctionByIndex(this, CalleeBF);
398389
} else {
399390
// Absolute symbol.
400391
ErrorOr<uint64_t> CalleeAddressOrError = BC.getSymbolValue(*CalleeSymbol);

bolt/lib/Passes/ReorderFunctions.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -473,16 +473,7 @@ Error ReorderFunctions::runOnFunctions(BinaryContext &BC) {
473473
[](BinaryFunction &BF) { return &BF; });
474474

475475
// Sort functions by index.
476-
llvm::stable_sort(SortedFunctions,
477-
[](const BinaryFunction *A, const BinaryFunction *B) {
478-
if (A->hasValidIndex() && B->hasValidIndex())
479-
return A->getIndex() < B->getIndex();
480-
if (A->hasValidIndex() && !B->hasValidIndex())
481-
return true;
482-
if (!A->hasValidIndex() && B->hasValidIndex())
483-
return false;
484-
return A->getAddress() < B->getAddress();
485-
});
476+
llvm::stable_sort(SortedFunctions, compareBinaryFunctionByIndex);
486477

487478
for (const BinaryFunction *Func : SortedFunctions) {
488479
if (!Func->hasValidIndex())

bolt/test/AArch64/data-at-0-offset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang %cflags -O2 -fPIE -Wl,-q -pie %s -o %t.exe
1+
// RUN: %clang %cflags -O2 -fPIE -std=gnu99 -Wl,-q -pie %s -o %t.exe
22
// RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s
33
// CHECK-NOT: BOLT-WARNING: unable to disassemble instruction at offset
44

bolt/test/AArch64/double_jump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// A contrived example to test the double jump removal peephole.
22

3-
// RUN: %clang %cflags -O0 %s -o %t.exe
3+
// RUN: %clangxx %cxxflags -O0 %s -o %t.exe
44
// RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=double-jumps | \
55
// RUN: FileCheck %s -check-prefix=CHECKBOLT
66
// RUN: llvm-objdump --no-print-imm-hex -d %t.bolt | FileCheck %s

bolt/test/R_ABS.pic.lld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* with libc available.
77
* REQUIRES: system-linux
88
*
9-
* RUN: %clang %cflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
9+
* RUN: %clangxx %cxxflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
1010
* RUN: llvm-bolt %t.so -o %t.so.bolt --relocs
1111
*/
1212

bolt/test/X86/double-jump.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## correctly on Windows e.g. subshell execution
55
REQUIRES: shell
66

7-
RUN: %clang %cflags %p/Inputs/double_jump.cpp -o %t.exe
7+
RUN: %clangxx %cxxflags %p/Inputs/double_jump.cpp -o %t.exe
88
RUN: (llvm-bolt %t.exe --peepholes=double-jumps \
99
RUN: --eliminate-unreachable -o %t 2>&1 \
1010
RUN: && llvm-objdump -d %t --print-imm-hex --no-show-raw-insn) | FileCheck %s

bolt/test/X86/dwarf5-df-inlined-subroutine-gc-sections-range.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; RUN: -split-dwarf-file=main.dwo -o main.o
77
; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-inlined-subroutine-gc-sections-range-helper.s \
88
; RUN: -split-dwarf-file=helper.dwo -o helper.o
9-
; RUN: %clang --target=x86_64-pc-linux -fuse-ld=lld -Wl,-gc-sections -Wl,-q -gdwarf-5 -gsplit-dwarf=split main.o helper.o -o main.exe
9+
; RUN: %clang -fuse-ld=lld -Wl,-gc-sections -Wl,-q -gdwarf-5 -gsplit-dwarf=split main.o helper.o -o main.exe
1010
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
1111
; RUN: llvm-dwarfdump --debug-addr main.exe > log.txt
1212
; RUN: llvm-dwarfdump --debug-rnglists --verbose --show-form main.dwo >> log.txt

0 commit comments

Comments
 (0)