Skip to content

Commit 8417da5

Browse files
authored
Merge branch 'main' into env_cindex
2 parents 2b52da5 + 63ea353 commit 8417da5

File tree

1,018 files changed

+37556
-13157
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,018 files changed

+37556
-13157
lines changed

.ci/generate_test_report_lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def generate_report(
184184
if return_code == 0:
185185
report.extend(
186186
[
187-
"The build succeeded and no tests ran. This is expected in some "
188-
"build configurations."
187+
":white_check_mark: The build succeeded and no tests ran. "
188+
"This is expected in some build configurations."
189189
]
190190
)
191191
else:
@@ -272,6 +272,10 @@ def plural(num_tests):
272272
]
273273
)
274274
report.extend(_format_failures(ninja_failures, failure_explanations))
275+
else:
276+
report.extend(
277+
["", ":white_check_mark: The build succeeded and all tests passed."]
278+
)
275279

276280
if failures or return_code != 0:
277281
report.extend(["", UNRELATED_FAILURES_STR])

.ci/generate_test_report_lib_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_title_only(self):
194194
"""\
195195
# Foo
196196
197-
The build succeeded and no tests ran. This is expected in some build configurations."""
197+
:white_check_mark: The build succeeded and no tests ran. This is expected in some build configurations."""
198198
),
199199
)
200200

@@ -308,7 +308,9 @@ def test_no_failures(self):
308308
"""\
309309
# Foo
310310
311-
* 1 test passed"""
311+
* 1 test passed
312+
313+
:white_check_mark: The build succeeded and all tests passed."""
312314
)
313315
),
314316
)

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ jobs:
223223
source .venv/bin/activate
224224
python -m pip install psutil
225225
xcrun bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
226+
env:
227+
CC: clang
228+
CXX: clang++
226229
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
227230
if: always() # Upload artifacts even if the build or test suite fails
228231
with:
@@ -241,16 +244,16 @@ jobs:
241244
fail-fast: false
242245
matrix:
243246
include:
244-
- { config: clang-cl-dll, mingw: false }
245-
- { config: clang-cl-static, mingw: false }
246-
- { config: clang-cl-no-vcruntime, mingw: false }
247-
- { config: clang-cl-debug, mingw: false }
248-
- { config: clang-cl-static-crt, mingw: false }
249-
- { config: mingw-dll, mingw: true }
250-
- { config: mingw-static, mingw: true }
251-
- { config: mingw-dll-i686, mingw: true }
252-
- { config: mingw-incomplete-sysroot, mingw: true }
253-
- { config: mingw-static, mingw: true, runner: windows-11-arm }
247+
- { config: clang-cl-dll, mingw: false, cc: clang-cl, cxx: clang-cl }
248+
- { config: clang-cl-static, mingw: false, cc: clang-cl, cxx: clang-cl }
249+
- { config: clang-cl-no-vcruntime, mingw: false, cc: clang-cl, cxx: clang-cl }
250+
- { config: clang-cl-debug, mingw: false, cc: clang-cl, cxx: clang-cl }
251+
- { config: clang-cl-static-crt, mingw: false, cc: clang-cl, cxx: clang-cl }
252+
- { config: mingw-dll, mingw: true, cc: cc, cxx: c++ }
253+
- { config: mingw-dll, mingw: true, cc: i686-w64-mingw32-clang, cxx: i686-w64-mingw32-clang++ }
254+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++ }
255+
- { config: mingw-incomplete-sysroot, mingw: true, cc: cc, cxx: c++ }
256+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++, runner: windows-11-arm }
254257
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-2022' }}
255258
steps:
256259
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -286,5 +289,7 @@ jobs:
286289
run: |
287290
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
288291
- name: Build and test
289-
run: |
290-
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
292+
run: bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
293+
env:
294+
CC: ${{ matrix.cc }}
295+
CXX: ${{ matrix.cxx }}

.github/workflows/libcxx-check-generated-files.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ jobs:
2222

2323
- name: Check generated files
2424
run: libcxx/utils/ci/run-buildbot check-generated-output
25+
env:
26+
CC: cc
27+
CXX: c++

.github/workflows/test-unprivileged-download-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-24.04
3838
needs: [ upload-test-artifact ]
3939
steps:
40-
- name: Chekcout LLVM
40+
- name: Checkout LLVM
4141
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4242
with:
4343
sparse-checkout: |

bolt/docs/BAT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Functions table:
6161

6262
### Functions table
6363
Hot and cold functions tables share the encoding except differences marked below.
64+
6465
Header:
6566
| Entry | Encoding | Description |
6667
| ------ | ----- | ----------- |

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ namespace opts {
8080
extern cl::list<std::string> HotTextMoveSections;
8181
extern cl::opt<bool> Hugify;
8282
extern cl::opt<bool> Instrument;
83+
extern cl::opt<uint32_t> InstrumentationSleepTime;
8384
extern cl::opt<bool> KeepNops;
8485
extern cl::opt<bool> Lite;
8586
extern cl::list<std::string> PrintOnly;
@@ -1507,6 +1508,9 @@ Error RewriteInstance::discoverRtFiniAddress() {
15071508
}
15081509

15091510
if (!BC->FiniArrayAddress || !BC->FiniArraySize) {
1511+
// Missing fini hooks are allowed when instrumentation-sleep-time is in use.
1512+
if (opts::InstrumentationSleepTime > 0)
1513+
return Error::success();
15101514
return createStringError(
15111515
std::errc::not_supported,
15121516
"Instrumentation needs either DT_FINI or DT_FINI_ARRAY");
@@ -1616,9 +1620,13 @@ Error RewriteInstance::updateRtFiniReloc() {
16161620
if (!RT || !RT->getRuntimeFiniAddress())
16171621
return Error::success();
16181622

1619-
if (!BC->FiniArrayAddress || !BC->FiniArraySize)
1623+
if (!BC->FiniArrayAddress || !BC->FiniArraySize) {
1624+
// Missing fini hooks are allowed when instrumentation-sleep-time is in use.
1625+
if (opts::InstrumentationSleepTime > 0)
1626+
return Error::success();
16201627
return createStringError(std::errc::not_supported,
16211628
"inconsistent .fini_array state");
1629+
}
16221630

16231631
ErrorOr<BinarySection &> FiniArraySection =
16241632
BC->getSectionForAddress(*BC->FiniArrayAddress);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Test that BOLT will produce error by default and pass with instrumentation-sleep-time option
2+
3+
# REQUIRES: system-linux,bolt-runtime,target=aarch64{{.*}}
4+
5+
# RUN: llvm-mc -triple aarch64 -filetype=obj %s -o %t.o
6+
# RUN: ld.lld -q -pie -o %t.exe %t.o
7+
# RUN: llvm-readelf -d %t.exe | FileCheck --check-prefix=CHECK-NO-FINI %s
8+
# RUN: not llvm-bolt --instrument -o %t.out %t.exe 2>&1 | FileCheck %s --check-prefix=CHECK-BOLT-FAIL
9+
# RUN: llvm-bolt --instrument --instrumentation-sleep-time=1 -o %t.out %t.exe 2>&1 | FileCheck %s --check-prefix=CHECK-BOLT-PASS
10+
11+
# CHECK-NO-FINI: INIT
12+
# CHECK-NO-FINI-NOT: FINI
13+
# CHECK-NO-FINI-NOT: FINI_ARRAY
14+
15+
# CHECK-BOLT-FAIL: Instrumentation needs either DT_FINI or DT_FINI_ARRAY
16+
17+
# CHECK-BOLT-PASS-NOT: Instrumentation needs either DT_FINI or DT_FINI_ARRAY
18+
# CHECK-BOLT-PASS: runtime library initialization was hooked via DT_INIT
19+
20+
.text
21+
.globl _start
22+
.type _start, %function
23+
_start:
24+
# BOLT errs when instrumenting without relocations; create a dummy one.
25+
.reloc 0, R_AARCH64_NONE
26+
ret
27+
.size _start, .-_start
28+
29+
.globl _init
30+
.type _init, %function
31+
# Force DT_INIT to be created (needed for instrumentation).
32+
_init:
33+
ret
34+
.size _init, .-_init

bolt/test/X86/instrument-no-fini.s

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Test that BOLT will produce error by default and pass with instrumentation-sleep-time option
2+
3+
# REQUIRES: system-linux,bolt-runtime,target=x86_64-{{.*}}
4+
5+
# RUN: llvm-mc -triple x86_64 -filetype=obj %s -o %t.o
6+
# RUN: ld.lld -q -pie -o %t.exe %t.o
7+
# RUN: llvm-readelf -d %t.exe | FileCheck --check-prefix=CHECK-NO-FINI %s
8+
# RUN: not llvm-bolt --instrument -o %t.out %t.exe 2>&1 | FileCheck %s --check-prefix=CHECK-BOLT-FAIL
9+
# RUN: llvm-bolt --instrument --instrumentation-sleep-time=1 -o %t.out %t.exe 2>&1 | FileCheck %s --check-prefix=CHECK-BOLT-PASS
10+
11+
# CHECK-NO-FINI: INIT
12+
# CHECK-NO-FINI-NOT: FINI
13+
# CHECK-NO-FINI-NOT: FINI_ARRAY
14+
15+
# CHECK-BOLT-FAIL: Instrumentation needs either DT_FINI or DT_FINI_ARRAY
16+
17+
# CHECK-BOLT-PASS-NOT: Instrumentation needs either DT_FINI or DT_FINI_ARRAY
18+
# CHECK-BOLT-PASS: runtime library initialization was hooked via DT_INIT
19+
20+
.text
21+
.globl _start
22+
.type _start, %function
23+
_start:
24+
# BOLT errs when instrumenting without relocations; create a dummy one.
25+
.reloc 0, R_X86_64_NONE
26+
retq
27+
.size _start, .-_start
28+
29+
.globl _init
30+
.type _init, %function
31+
# Force DT_INIT to be created (needed for instrumentation).
32+
_init:
33+
retq
34+
.size _init, .-_init

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Checks: >
3232
-readability-qualified-auto,
3333
-readability-simplify-boolean-expr,
3434
-readability-static-definition-in-anonymous-namespace,
35-
-readability-suspicious-call-argument,
36-
-readability-use-anyofallof
35+
-readability-suspicious-call-argument
3736
3837
CheckOptions:
3938
- key: performance-move-const-arg.CheckTriviallyCopyableMove

0 commit comments

Comments
 (0)