Skip to content

Commit 5f711e2

Browse files
committed
Merge from 'main' to 'sycl-web' (212 commits)
CONFLICT (content): Merge conflict in libclc/cmake/modules/AddLibclc.cmake
2 parents c2e8cf7 + e421ef2 commit 5f711e2

File tree

719 files changed

+42417
-30192
lines changed

Some content is hidden

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

719 files changed

+42417
-30192
lines changed
Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
# This file defines pre-commit CI for libc++, libc++abi, and libunwind (on Github).
2+
#
3+
# We split the configurations in multiple stages with the intent of saving compute time
4+
# when a job fails early in the pipeline. This is why the jobs are marked as `continue-on-error: false`.
5+
# We try to run the CI configurations with the most signal in the first stage.
6+
#
7+
# Stages 1 & 2 are meant to be "smoke tests", and are meant to catch most build/test failures quickly and without using
8+
# too many resources.
9+
# Stage 3 is "everything else", and is meant to catch breakages on more niche or unique configurations.
10+
#
11+
# Therefore, we "fail-fast" for any failures during stages 1 & 2, meaning any job failing cancels all other running jobs,
12+
# under the assumption that if the "smoke tests" fail, then the other configurations will likely fail in the same way.
13+
# However, stage 3 does not fail fast, as it's more likely that any one job failing is a flake or a configuration-specific
14+
#
15+
name: Build and Test libc++
16+
on:
17+
pull_request:
18+
paths:
19+
- 'libcxx/**'
20+
- 'libcxxabi/**'
21+
- 'libunwind/**'
22+
- 'runtimes/**'
23+
- 'cmake/**'
24+
- '.github/workflows/libcxx-build-and-test.yaml'
25+
schedule:
26+
# Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern)
27+
- cron: '0 8 * * *'
28+
29+
permissions:
30+
contents: read # Default everything to read-only
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
stage1:
38+
if: github.repository_owner == 'llvm'
39+
runs-on: llvm-premerge-libcxx-runners
40+
continue-on-error: false
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
config: [
45+
'frozen-cxx03-headers',
46+
'generic-cxx03',
47+
'generic-cxx26',
48+
'generic-modules'
49+
]
50+
cc: [ 'clang-22' ]
51+
cxx: [ 'clang++-22' ]
52+
include:
53+
- config: 'generic-gcc'
54+
cc: 'gcc-15'
55+
cxx: 'g++-15'
56+
steps:
57+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
58+
- name: ${{ matrix.config }}.${{ matrix.cxx }}
59+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
60+
env:
61+
CC: ${{ matrix.cc }}
62+
CXX: ${{ matrix.cxx }}
63+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
64+
if: always()
65+
with:
66+
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
67+
path: |
68+
**/test-results.xml
69+
**/*.abilist
70+
**/CMakeConfigureLog.yaml
71+
**/CMakeError.log
72+
**/CMakeOutput.log
73+
**/crash_diagnostics/*
74+
stage2:
75+
if: github.repository_owner == 'llvm'
76+
runs-on: llvm-premerge-libcxx-runners
77+
needs: [ stage1 ]
78+
continue-on-error: false
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
config: [
83+
'generic-cxx11',
84+
'generic-cxx14',
85+
'generic-cxx17',
86+
'generic-cxx20',
87+
'generic-cxx23'
88+
]
89+
cc: [ 'clang-22' ]
90+
cxx: [ 'clang++-22' ]
91+
include:
92+
- config: 'generic-gcc-cxx11'
93+
cc: 'gcc-15'
94+
cxx: 'g++-15'
95+
- config: 'generic-cxx26'
96+
cc: 'clang-21'
97+
cxx: 'clang++-21'
98+
- config: 'generic-cxx26'
99+
cc: 'clang-20'
100+
cxx: 'clang++-20'
101+
steps:
102+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
103+
- name: ${{ matrix.config }}
104+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
105+
env:
106+
CC: ${{ matrix.cc }}
107+
CXX: ${{ matrix.cxx }}
108+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
109+
if: always() # Upload artifacts even if the build or test suite fails
110+
with:
111+
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
112+
path: |
113+
**/test-results.xml
114+
**/*.abilist
115+
**/CMakeConfigureLog.yaml
116+
**/CMakeError.log
117+
**/CMakeOutput.log
118+
**/crash_diagnostics/*
119+
stage3:
120+
if: github.repository_owner == 'llvm'
121+
needs: [ stage2 ]
122+
continue-on-error: false
123+
strategy:
124+
fail-fast: false
125+
max-parallel: 8
126+
matrix:
127+
config: [
128+
'generic-abi-unstable',
129+
'generic-hardening-mode-debug',
130+
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
132+
'generic-hardening-mode-fast',
133+
'generic-hardening-mode-fast-with-abi-breaks',
134+
'generic-merged',
135+
'generic-modules-cxx17-lsv',
136+
'generic-no-exceptions',
137+
'generic-no-experimental',
138+
'generic-no-filesystem',
139+
'generic-no-localization',
140+
'generic-no-terminal',
141+
'generic-no-random_device',
142+
'generic-no-threads',
143+
'generic-no-tzdb',
144+
'generic-no-unicode',
145+
'generic-no-wide-characters',
146+
'generic-no-rtti',
147+
'generic-optimized-speed',
148+
'generic-static',
149+
'bootstrapping-build'
150+
]
151+
machine: [ 'llvm-premerge-libcxx-runners' ]
152+
include:
153+
- config: 'generic-cxx26'
154+
machine: llvm-premerge-libcxx-runners
155+
- config: 'generic-asan'
156+
machine: llvm-premerge-libcxx-runners
157+
- config: 'generic-asan-in-tests-only'
158+
machine: llvm-premerge-libcxx-runners
159+
- config: 'generic-tsan'
160+
machine: llvm-premerge-libcxx-runners
161+
- config: 'generic-ubsan'
162+
machine: llvm-premerge-libcxx-runners
163+
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
164+
- config: 'generic-msan'
165+
machine: llvm-premerge-libcxx-runners
166+
runs-on: ${{ matrix.machine }}
167+
steps:
168+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
169+
- name: ${{ matrix.config }}
170+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171+
env:
172+
CC: clang-22
173+
CXX: clang++-22
174+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
175+
if: always()
176+
with:
177+
name: ${{ matrix.config }}-results
178+
path: |
179+
**/test-results.xml
180+
**/*.abilist
181+
**/CMakeConfigureLog.yaml
182+
**/CMakeError.log
183+
**/CMakeOutput.log
184+
**/crash_diagnostics/*
185+
186+
macos:
187+
needs: [ stage2 ]
188+
strategy:
189+
fail-fast: false
190+
matrix:
191+
include:
192+
- config: generic-cxx03
193+
os: macos-15
194+
- config: generic-cxx23
195+
os: macos-15
196+
- config: generic-modules
197+
os: macos-15
198+
- config: apple-configuration
199+
os: macos-15
200+
# TODO: These jobs are intended to test back-deployment (building against ToT libc++ but running against an
201+
# older system-provided libc++.dylib). Doing this properly would require building the test suite on a
202+
# recent macOS using a recent Clang (hence recent Xcode), and then running the actual test suite on an
203+
# older mac. We could do that by e.g. sharing artifacts between the two jobs.
204+
#
205+
# However, our Lit configuration currently doesn't provide a good way to do that in a batch, so our only
206+
# alternative is to actually build on the same host that we're going to run on. Sadly, that doesn't work
207+
# since older macOSes don't support newer Xcodes. For now, we run the "backdeployment" jobs on recent
208+
# macOS versions as a way to avoid rotting that configuration, but it doesn't provide a lot of additional
209+
# coverage.
210+
- config: apple-system
211+
os: macos-15
212+
- config: apple-system-hardened
213+
os: macos-15
214+
runs-on: ${{ matrix.os }}
215+
steps:
216+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
217+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
218+
with:
219+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
220+
xcode-version: '26.0'
221+
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
222+
- name: Build and test
223+
run: |
224+
python3 -m venv .venv
225+
source .venv/bin/activate
226+
python -m pip install psutil
227+
xcrun bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
228+
env:
229+
CC: clang
230+
CXX: clang++
231+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
232+
if: always() # Upload artifacts even if the build or test suite fails
233+
with:
234+
name: macos-${{ matrix.config }}-results
235+
path: |
236+
**/test-results.xml
237+
**/*.abilist
238+
**/CMakeConfigureLog.yaml
239+
**/CMakeError.log
240+
**/CMakeOutput.log
241+
**/crash_diagnostics/*
242+
243+
windows:
244+
needs: [ stage2 ]
245+
strategy:
246+
fail-fast: false
247+
matrix:
248+
include:
249+
- { config: clang-cl-dll, mingw: false, cc: clang-cl, cxx: clang-cl }
250+
- { config: clang-cl-static, mingw: false, cc: clang-cl, cxx: clang-cl }
251+
- { config: clang-cl-no-vcruntime, mingw: false, cc: clang-cl, cxx: clang-cl }
252+
- { config: clang-cl-debug, mingw: false, cc: clang-cl, cxx: clang-cl }
253+
- { config: clang-cl-static-crt, mingw: false, cc: clang-cl, cxx: clang-cl }
254+
- { config: mingw-dll, mingw: true, cc: cc, cxx: c++ }
255+
- { config: mingw-dll, mingw: true, cc: i686-w64-mingw32-clang, cxx: i686-w64-mingw32-clang++ }
256+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++ }
257+
- { config: mingw-incomplete-sysroot, mingw: true, cc: cc, cxx: c++ }
258+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++, runner: windows-11-arm }
259+
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-2022' }}
260+
steps:
261+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
262+
- name: Install dependencies
263+
run: |
264+
pip install psutil
265+
- name: Install a current LLVM
266+
if: ${{ matrix.mingw != true }}
267+
run: |
268+
choco install -y llvm --version=20.1.8 --allow-downgrade
269+
- name: Install llvm-mingw
270+
if: ${{ matrix.mingw == true }}
271+
run: |
272+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-${{ matrix.runner == 'windows-11-arm' && 'aarch64' || 'x86_64' }}.zip
273+
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
274+
del llvm-mingw*.zip
275+
mv llvm-mingw* c:\llvm-mingw
276+
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
277+
- name: Simulate a from-scratch build of llvm-mingw
278+
if: ${{ matrix.config == 'mingw-incomplete-sysroot' }}
279+
run: |
280+
rm -r c:\llvm-mingw\include\c++
281+
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libc++*
282+
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libunwind*
283+
- name: Add Git Bash to the path
284+
run: |
285+
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
286+
- name: Set up the MSVC dev environment
287+
if: ${{ matrix.mingw != true }}
288+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
289+
- name: Add the installed Clang at the start of the path
290+
if: ${{ matrix.mingw != true }}
291+
run: |
292+
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
293+
- name: Build and test
294+
run: bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
295+
env:
296+
CC: ${{ matrix.cc }}
297+
CXX: ${{ matrix.cxx }}

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
245245
Inst.setOpcode(Opcode);
246246
Inst.clear();
247247
Inst.addOperand(MCOperand::createExpr(MCSpecifierExpr::create(
248-
MCSymbolRefExpr::create(Target, *Ctx), ELF::R_RISCV_CALL_PLT, *Ctx)));
248+
MCSymbolRefExpr::create(Target, *Ctx), RISCV::S_CALL_PLT, *Ctx)));
249249
}
250250

251251
void createCall(MCInst &Inst, const MCSymbol *Target,
@@ -433,7 +433,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
433433
case ELF::R_RISCV_TLS_GD_HI20:
434434
// The GOT is reused so no need to create GOT relocations
435435
case ELF::R_RISCV_PCREL_HI20:
436-
return MCSpecifierExpr::create(Expr, ELF::R_RISCV_PCREL_HI20, Ctx);
436+
return MCSpecifierExpr::create(Expr, RISCV::S_PCREL_HI, Ctx);
437437
case ELF::R_RISCV_PCREL_LO12_I:
438438
case ELF::R_RISCV_PCREL_LO12_S:
439439
return MCSpecifierExpr::create(Expr, RISCV::S_PCREL_LO, Ctx);
@@ -443,9 +443,9 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
443443
case ELF::R_RISCV_LO12_S:
444444
return MCSpecifierExpr::create(Expr, RISCV::S_LO, Ctx);
445445
case ELF::R_RISCV_CALL:
446-
return MCSpecifierExpr::create(Expr, ELF::R_RISCV_CALL_PLT, Ctx);
446+
return MCSpecifierExpr::create(Expr, RISCV::S_CALL_PLT, Ctx);
447447
case ELF::R_RISCV_CALL_PLT:
448-
return MCSpecifierExpr::create(Expr, ELF::R_RISCV_CALL_PLT, Ctx);
448+
return MCSpecifierExpr::create(Expr, RISCV::S_CALL_PLT, Ctx);
449449
}
450450
}
451451

@@ -470,6 +470,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
470470
switch (cast<MCSpecifierExpr>(ImmExpr)->getSpecifier()) {
471471
default:
472472
return false;
473+
case RISCV::S_CALL_PLT:
473474
case ELF::R_RISCV_CALL_PLT:
474475
return true;
475476
}

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,15 @@ static MoveType determineMoveType(const FunctionDecl *FuncDecl) {
436436

437437
static void emitDiagnostic(const Expr *MovingCall, const DeclRefExpr *MoveArg,
438438
const UseAfterMove &Use, ClangTidyCheck *Check,
439-
ASTContext *Context, MoveType Type) {
439+
ASTContext *Context, MoveType Type,
440+
const FunctionDecl *MoveDecl) {
440441
const SourceLocation UseLoc = Use.DeclRef->getExprLoc();
441442
const SourceLocation MoveLoc = MovingCall->getExprLoc();
442443

443-
Check->diag(UseLoc,
444-
"'%0' used after it was %select{forwarded|moved|invalidated}1")
445-
<< MoveArg->getDecl()->getName() << Type;
444+
Check->diag(
445+
UseLoc,
446+
"'%0' used after it was %select{forwarded|moved|invalidated by %2}1")
447+
<< MoveArg->getDecl()->getName() << Type << MoveDecl;
446448
Check->diag(MoveLoc, "%select{forward|move|invalidation}0 occurred here",
447449
DiagnosticIDs::Note)
448450
<< Type;
@@ -573,7 +575,7 @@ void UseAfterMoveCheck::check(const MatchFinder::MatchResult &Result) {
573575
ReinitializationFunctions);
574576
if (auto Use = Finder.find(CodeBlock, MovingCall, Arg))
575577
emitDiagnostic(MovingCall, Arg, *Use, this, Result.Context,
576-
determineMoveType(MoveDecl));
578+
determineMoveType(MoveDecl), MoveDecl);
577579
}
578580
}
579581

0 commit comments

Comments
 (0)