Skip to content

Commit edeef3c

Browse files
authored
Merge branch 'main' into has-feature-cfi
2 parents 9733879 + 5482ef7 commit edeef3c

File tree

1,790 files changed

+88815
-35363
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,790 files changed

+88815
-35363
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
/mlir/**/Transforms/SROA.* @moxinilian
130130

131131
# BOLT
132-
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis
132+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis @yozhu
133133

134134
# Bazel build system.
135135
/utils/bazel/ @rupprecht @keith @aaronmondal

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
'generic-abi-unstable',
129129
'generic-hardening-mode-debug',
130130
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
131132
'generic-hardening-mode-fast',
132133
'generic-hardening-mode-fast-with-abi-breaks',
133134
'generic-merged',

.github/workflows/release-tasks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,31 @@ jobs:
111111
# Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use.
112112
secrets:
113113
RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
114+
115+
uncomment-download-links:
116+
name: Uncomment download links
117+
runs-on: ubuntu-24.04
118+
permissions:
119+
contents: write # For updating the release message.
120+
needs:
121+
- validate-tag
122+
- release-create
123+
- release-binaries
124+
125+
steps:
126+
- name: Install Dependencies
127+
run: |
128+
sudo apt-get update
129+
sudo apt-get install python3-github
130+
131+
- name: Checkout LLVM
132+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
133+
with:
134+
sparse-checkout: llvm/utils/release/github-upload-release.py
135+
sparse-checkout-cone-mode: false
136+
137+
- name: Uncomment Download Links
138+
env:
139+
GITHUB_TOKEN: ${{ github.token }}
140+
run: |
141+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} uncomment_download_links

bolt/lib/Core/Relocation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,15 @@ void Relocation::print(raw_ostream &OS) const {
10181018
OS << "RType:" << Twine::utohexstr(Type);
10191019
break;
10201020

1021-
case Triple::aarch64:
1021+
case Triple::aarch64: {
10221022
static const char *const AArch64RelocNames[] = {
10231023
#define ELF_RELOC(name, value) #name,
10241024
#include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
10251025
#undef ELF_RELOC
10261026
};
10271027
assert(Type < ArrayRef(AArch64RelocNames).size());
10281028
OS << AArch64RelocNames[Type];
1029-
break;
1029+
} break;
10301030

10311031
case Triple::riscv64:
10321032
// RISC-V relocations are not sequentially numbered so we cannot use an
@@ -1043,15 +1043,15 @@ void Relocation::print(raw_ostream &OS) const {
10431043
}
10441044
break;
10451045

1046-
case Triple::x86_64:
1046+
case Triple::x86_64: {
10471047
static const char *const X86RelocNames[] = {
10481048
#define ELF_RELOC(name, value) #name,
10491049
#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
10501050
#undef ELF_RELOC
10511051
};
10521052
assert(Type < ArrayRef(X86RelocNames).size());
10531053
OS << X86RelocNames[Type];
1054-
break;
1054+
} break;
10551055
}
10561056
OS << ", 0x" << Twine::utohexstr(Offset);
10571057
if (Symbol) {

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,20 @@ void RewriteInstance::discoverFileObjects() {
896896
continue;
897897

898898
MarkerSymType MarkerType = BC->getMarkerType(SymInfo.Symbol);
899+
900+
// Treat ST_Function as code.
901+
Expected<object::SymbolRef::Type> TypeOrError = SymInfo.Symbol.getType();
902+
consumeError(TypeOrError.takeError());
903+
if (TypeOrError && *TypeOrError == SymbolRef::ST_Function) {
904+
if (IsData) {
905+
Expected<StringRef> NameOrError = SymInfo.Symbol.getName();
906+
consumeError(NameOrError.takeError());
907+
BC->errs() << "BOLT-WARNING: function symbol " << *NameOrError
908+
<< " lacks code marker\n";
909+
}
910+
MarkerType = MarkerSymType::CODE;
911+
}
912+
899913
if (MarkerType != MarkerSymType::NONE) {
900914
SortedMarkerSymbols.push_back(MarkerSym{SymInfo.Address, MarkerType});
901915
LastAddr = SymInfo.Address;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Check that llvm-bolt is able to recover a missing code marker.
2+
3+
# RUN: %clang %cflags %s -o %t.exe -nostdlib -fuse-ld=lld -Wl,-q
4+
# RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s
5+
6+
# CHECK: BOLT-WARNING: function symbol foo lacks code marker
7+
8+
.text
9+
.balign 4
10+
11+
.word 0
12+
13+
## Function foo starts immediately after a data object and does not have
14+
## a matching "$x" symbol to indicate the start of code.
15+
.global foo
16+
.type foo, %function
17+
foo:
18+
.word 0xd65f03c0
19+
.size foo, .-foo
20+
21+
.global _start
22+
.type _start, %function
23+
_start:
24+
bl foo
25+
ret
26+
.size _start, .-_start

bolt/test/binary-analysis/AArch64/cmdline-args.test

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
# Verify that an error message is provided if an input file is missing or incorrect
55

66
RUN: not llvm-bolt-binary-analysis 2>&1 | FileCheck -check-prefix=NOFILEARG %s
7-
NOFILEARG: llvm-bolt-binary-analysis: Not enough positional command line arguments specified!
8-
NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis --help
7+
NOFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: Not enough positional command line arguments specified!
8+
NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis{{(\.exe)?}} --help
99

1010
RUN: not llvm-bolt-binary-analysis non-existing-file 2>&1 | FileCheck -check-prefix=NONEXISTINGFILEARG %s
11-
NONEXISTINGFILEARG: llvm-bolt-binary-analysis: 'non-existing-file': No such file or directory.
11+
# Don't check the OS-dependent message "No such file or directory".
12+
NONEXISTINGFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: 'non-existing-file': {{.*}}
1213

1314
RUN: not llvm-bolt-binary-analysis %p/Inputs/dummy.txt 2>&1 | FileCheck -check-prefix=NOELFFILEARG %s
14-
NOELFFILEARG: llvm-bolt-binary-analysis: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file.
15+
NOELFFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file.
1516

1617
RUN: %clang %cflags -Wl,--emit-relocs %p/../../Inputs/asm_foo.s %p/../../Inputs/asm_main.c -o %t.exe
1718
RUN: llvm-bolt-binary-analysis %t.exe 2>&1 | FileCheck -check-prefix=VALIDELFFILEARG --allow-empty %s
@@ -26,7 +27,7 @@ RUN: llvm-bolt-binary-analysis --help 2>&1 | FileCheck -check-prefix=HELP %s
2627

2728
HELP: OVERVIEW: BinaryAnalysis
2829
HELP-EMPTY:
29-
HELP-NEXT: USAGE: llvm-bolt-binary-analysis [options] <executable>
30+
HELP-NEXT: USAGE: llvm-bolt-binary-analysis{{(\.exe)?}} [options] <executable>
3031
HELP-EMPTY:
3132
HELP-NEXT: OPTIONS:
3233
HELP-EMPTY:

bolt/test/lsda-section-name.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// This test check that LSDA section named by .gcc_except_table.main is
22
// disassembled by BOLT.
33

4-
// RUN: %clang++ %cxxflags -O3 -no-pie -c %s -o %t.o
5-
// RUN: %clang++ %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t
4+
// RUN: %clangxx %cxxflags -O3 -no-pie -c %s -o %t.o
5+
// RUN: %clangxx %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t
66
// RUN: llvm-objcopy --rename-section .gcc_except_table=.gcc_except_table.main %t
77
// RUN: llvm-readelf -SW %t | FileCheck %s
88
// RUN: llvm-bolt %t -o %t.bolt

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
502502
}
503503

504504
void ScopeChildren::sort() {
505-
llvm::sort(Namespaces.begin(), Namespaces.end());
506-
llvm::sort(Records.begin(), Records.end());
507-
llvm::sort(Functions.begin(), Functions.end());
508-
llvm::sort(Enums.begin(), Enums.end());
509-
llvm::sort(Typedefs.begin(), Typedefs.end());
510-
llvm::sort(Concepts.begin(), Concepts.end());
511-
llvm::sort(Variables.begin(), Variables.end());
505+
llvm::sort(Namespaces);
506+
llvm::sort(Records);
507+
llvm::sort(Functions);
508+
llvm::sort(Enums);
509+
llvm::sort(Typedefs);
510+
llvm::sort(Concepts);
511+
llvm::sort(Variables);
512512
}
513513
} // namespace doc
514514
} // namespace clang

clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "IncorrectRoundingsCheck.h"
3939
#include "InfiniteLoopCheck.h"
4040
#include "IntegerDivisionCheck.h"
41+
#include "InvalidEnumDefaultInitializationCheck.h"
4142
#include "LambdaFunctionNameCheck.h"
4243
#include "MacroParenthesesCheck.h"
4344
#include "MacroRepeatedSideEffectsCheck.h"
@@ -165,6 +166,8 @@ class BugproneModule : public ClangTidyModule {
165166
CheckFactories.registerCheck<InfiniteLoopCheck>("bugprone-infinite-loop");
166167
CheckFactories.registerCheck<IntegerDivisionCheck>(
167168
"bugprone-integer-division");
169+
CheckFactories.registerCheck<InvalidEnumDefaultInitializationCheck>(
170+
"bugprone-invalid-enum-default-initialization");
168171
CheckFactories.registerCheck<LambdaFunctionNameCheck>(
169172
"bugprone-lambda-function-name");
170173
CheckFactories.registerCheck<MacroParenthesesCheck>(

0 commit comments

Comments
 (0)