Skip to content

Commit b196c71

Browse files
authored
Merge branch 'main' into eochoa/2025-08-05/alignment-bytes
2 parents 502bd1e + 86c1926 commit b196c71

File tree

2,600 files changed

+116304
-48256
lines changed

Some content is hidden

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

2,600 files changed

+116304
-48256
lines changed

.ci/compute_projects_test.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,34 @@ def test_ci(self):
284284
"check-cxx check-cxxabi check-unwind",
285285
)
286286

287+
def test_windows_ci(self):
288+
env_variables = compute_projects.get_env_variables(
289+
[".ci/compute_projects.py"], "Windows"
290+
)
291+
self.assertEqual(
292+
env_variables["projects_to_build"],
293+
"clang;clang-tools-extra;libclc;lld;llvm;mlir;polly",
294+
)
295+
self.assertEqual(
296+
env_variables["project_check_targets"],
297+
"check-clang check-clang-cir check-clang-tools check-lld check-llvm check-mlir check-polly",
298+
)
299+
self.assertEqual(
300+
env_variables["runtimes_to_build"],
301+
"libcxx;libcxxabi;libunwind",
302+
)
303+
self.assertEqual(
304+
env_variables["runtimes_check_targets"],
305+
"",
306+
)
307+
# TODO(boomanaiden154): We should not be emitting these on Windows.
308+
# It does not currently impact anything because we do not build the
309+
# runtimes on Windows though.
310+
self.assertEqual(
311+
env_variables["runtimes_check_targets_needs_reconfig"],
312+
"check-cxx check-cxxabi check-unwind",
313+
)
314+
287315
def test_lldb(self):
288316
env_variables = compute_projects.get_env_variables(
289317
["lldb/CMakeLists.txt"], "Linux"

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,32 @@ jobs:
2020
include:
2121
- os: ubuntu-24.04
2222
build_type: Debug
23-
ccache-variant: sccache
24-
c_compiler: clang-20
25-
cpp_compiler: clang++-20
23+
c_compiler: clang-22
24+
cpp_compiler: clang++-22
2625
target: x86_64-unknown-linux-llvm
2726
include_scudo: ON
2827
- os: ubuntu-24.04
2928
build_type: Release
30-
ccache-variant: sccache
31-
c_compiler: clang-20
32-
cpp_compiler: clang++-20
29+
c_compiler: clang-22
30+
cpp_compiler: clang++-22
3331
target: x86_64-unknown-linux-llvm
3432
include_scudo: ON
3533
- os: ubuntu-24.04
3634
build_type: MinSizeRel
37-
ccache-variant: sccache
38-
c_compiler: clang-20
39-
cpp_compiler: clang++-20
35+
c_compiler: clang-22
36+
cpp_compiler: clang++-22
4037
target: x86_64-unknown-linux-llvm
4138
include_scudo: ON
42-
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
4339
- os: ubuntu-24.04-arm
4440
build_type: Debug
45-
ccache-variant: ccache
46-
c_compiler: clang-20
47-
cpp_compiler: clang++-20
41+
c_compiler: clang-22
42+
cpp_compiler: clang++-22
4843
target: aarch64-unknown-linux-llvm
4944
include_scudo: ON
5045
- os: ubuntu-24.04
5146
build_type: Debug
52-
ccache-variant: ccache
53-
c_compiler: clang-20
54-
cpp_compiler: clang++-20
47+
c_compiler: clang-22
48+
cpp_compiler: clang++-22
5549
target: x86_64-unknown-uefi-llvm
5650
include_scudo: OFF
5751
# TODO: add back gcc build when it is fixed
@@ -71,7 +65,7 @@ jobs:
7165
with:
7266
max-size: 1G
7367
key: libc_fullbuild_${{ matrix.c_compiler }}
74-
variant: ${{ matrix.ccache-variant }}
68+
variant: sccache
7569

7670
# Notice:
7771
# - MPFR is required by some of the mathlib tests.
@@ -81,7 +75,7 @@ jobs:
8175
run: |
8276
wget https://apt.llvm.org/llvm.sh
8377
chmod +x llvm.sh
84-
sudo ./llvm.sh 20
78+
sudo ./llvm.sh 22
8579
sudo apt-get update
8680
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
8781
sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
@@ -112,8 +106,8 @@ jobs:
112106
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
113107
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
114108
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
115-
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
116-
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
109+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
110+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
117111
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
118112
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
119113
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \

.github/workflows/libc-overlay-tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,22 @@ jobs:
2020
include:
2121
# TODO: add linux gcc when it is fixed
2222
- os: ubuntu-24.04
23-
ccache-variant: sccache
2423
compiler:
2524
c_compiler: clang
2625
cpp_compiler: clang++
27-
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
2826
- os: ubuntu-24.04-arm
29-
ccache-variant: ccache
3027
compiler:
3128
c_compiler: clang
3229
cpp_compiler: clang++
3330
- os: windows-2022
34-
ccache-variant: sccache
3531
compiler:
3632
c_compiler: clang-cl
3733
cpp_compiler: clang-cl
3834
- os: windows-2025
39-
ccache-variant: sccache
4035
compiler:
4136
c_compiler: clang-cl
4237
cpp_compiler: clang-cl
4338
- os: macos-14
44-
ccache-variant: sccache
4539
compiler:
4640
c_compiler: clang
4741
cpp_compiler: clang++
@@ -61,7 +55,7 @@ jobs:
6155
with:
6256
max-size: 1G
6357
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
64-
variant: ${{ matrix.ccache-variant }}
58+
variant: sccache
6559

6660
# MPFR is required by some of the mathlib tests.
6761
- name: Prepare dependencies (Ubuntu)
@@ -97,8 +91,8 @@ jobs:
9791
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9892
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
9993
-DCMAKE_BUILD_TYPE=Debug
100-
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101-
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
94+
-DCMAKE_C_COMPILER_LAUNCHER=sccache
95+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
10296
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
10397
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
10498
-DLLVM_ENABLE_RUNTIMES=libc

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ jobs:
260260
- name: Install a current LLVM
261261
if: ${{ matrix.mingw != true }}
262262
run: |
263-
choco install -y llvm --version=19.1.7 --allow-downgrade
263+
choco install -y llvm --version=20.1.8 --allow-downgrade
264264
- name: Install llvm-mingw
265265
if: ${{ matrix.mingw == true }}
266266
run: |
267-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-x86_64.zip
267+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip
268268
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
269269
del llvm-mingw*.zip
270270
mv llvm-mingw* c:\llvm-mingw

bolt/lib/Core/Exceptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ bool CFIReaderWriter::fillCFIInfoFor(BinaryFunction &Function) const {
500500

501501
const FDE &CurFDE = *I->second;
502502
std::optional<uint64_t> LSDA = CurFDE.getLSDAAddress();
503-
Function.setLSDAAddress(LSDA ? *LSDA : 0);
503+
Function.setLSDAAddress(LSDA.value_or(0));
504504

505505
uint64_t Offset = Function.getFirstInstructionOffset();
506506
uint64_t CodeAlignment = CurFDE.getLinkedCIE()->getCodeAlignmentFactor();

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/link_fdata.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import argparse
1111
import os
12+
import platform
1213
import shutil
1314
import subprocess
1415
import sys
@@ -19,7 +20,11 @@
1920
parser.add_argument("objfile", help="Object file to extract symbol values from")
2021
parser.add_argument("output")
2122
parser.add_argument("prefix", nargs="?", default="FDATA", help="Custom FDATA prefix")
22-
parser.add_argument("--nmtool", default="nm", help="Path to nm tool")
23+
parser.add_argument(
24+
"--nmtool",
25+
default="llvm-nm" if platform.system() == "Windows" else "nm",
26+
help="Path to nm tool",
27+
)
2328
parser.add_argument("--no-lbr", action="store_true")
2429
parser.add_argument("--no-redefine", action="store_true")
2530

@@ -86,7 +91,10 @@
8691
exit("ERROR: unexpected input:\n%s" % line)
8792

8893
# Read nm output: <symbol value> <symbol type> <symbol name>
89-
is_llvm_nm = os.path.basename(os.path.realpath(shutil.which(args.nmtool))) == "llvm-nm"
94+
# Ignore .exe on Windows host.
95+
is_llvm_nm = os.path.basename(os.path.realpath(shutil.which(args.nmtool))).startswith(
96+
"llvm-nm"
97+
)
9098
nm_output = subprocess.run(
9199
[
92100
args.nmtool,

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-apply-replacements/tool/ClangApplyReplacementsMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ int main(int argc, char **argv) {
9797
cl::ParseCommandLineOptions(argc, argv);
9898

9999
DiagnosticOptions DiagOpts;
100-
DiagnosticsEngine Diagnostics(
101-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts);
100+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts);
102101

103102
// Determine a formatting style from options.
104103
auto FormatStyleOrError = format::getStyle(FormatStyleOpt, FormatStyleConfig,

clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ int main(int argc, const char **argv) {
128128
LangOptions DefaultLangOptions;
129129
DiagnosticOptions DiagOpts;
130130
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), DiagOpts);
131-
DiagnosticsEngine Diagnostics(
132-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts,
133-
&DiagnosticPrinter, false);
131+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts,
132+
&DiagnosticPrinter, false);
134133
auto &FileMgr = Tool.getFiles();
135134
SourceManager Sources(Diagnostics, FileMgr);
136135
Rewriter Rewrite(Sources, DefaultLangOptions);

0 commit comments

Comments
 (0)