Skip to content

Commit f421110

Browse files
authored
Merge branch 'main' into users/makslevental/stubgen
2 parents 4df87ae + 0a16d1a commit f421110

File tree

1,156 files changed

+159481
-8118
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,156 files changed

+159481
-8118
lines changed

.ci/compute_projects.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"libc": {"clang", "lld"},
2727
"openmp": {"clang", "lld"},
2828
"flang": {"llvm", "clang"},
29+
"flang-rt": {"flang"},
2930
"lldb": {"llvm", "clang"},
3031
"libclc": {"llvm", "clang"},
3132
"lld": {"llvm"},
@@ -80,7 +81,9 @@
8081
"clang-tools-extra": {"libc"},
8182
"libc": {"libc"},
8283
"compiler-rt": {"compiler-rt"},
83-
".ci": {"compiler-rt", "libc"},
84+
"flang": {"flang-rt"},
85+
"flang-rt": {"flang-rt"},
86+
".ci": {"compiler-rt", "libc", "flang-rt"},
8487
}
8588
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
8689
"llvm": {"libcxx", "libcxxabi", "libunwind"},
@@ -95,14 +98,14 @@
9598

9699
EXCLUDE_WINDOWS = {
97100
"cross-project-tests", # TODO(issues/132797): Tests are failing.
98-
"compiler-rt", # TODO(issues/132798): Tests take excessive time.
99101
"openmp", # TODO(issues/132799): Does not detect perl installation.
100102
"libc", # No Windows Support.
101103
"lldb", # TODO(issues/132800): Needs environment setup.
102104
"bolt", # No Windows Support.
103105
"libcxx",
104106
"libcxxabi",
105107
"libunwind",
108+
"flang-rt",
106109
}
107110

108111
# These are projects that we should test if the project itself is changed but
@@ -140,6 +143,7 @@
140143
"bolt": "check-bolt",
141144
"lld": "check-lld",
142145
"flang": "check-flang",
146+
"flang-rt": "check-flang-rt",
143147
"libc": "check-libc",
144148
"lld": "check-lld",
145149
"lldb": "check-lldb",
@@ -148,7 +152,7 @@
148152
"polly": "check-polly",
149153
}
150154

151-
RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc"}
155+
RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc", "flang-rt"}
152156

153157
# Meta projects are projects that need explicit handling but do not reside
154158
# in their own top level folder. To add a meta project, the start of the path

.ci/compute_projects_test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ def test_clang_windows(self):
110110
["clang/CMakeLists.txt"], "Windows"
111111
)
112112
self.assertEqual(
113-
env_variables["projects_to_build"], "clang;clang-tools-extra;llvm"
113+
env_variables["projects_to_build"], "clang;clang-tools-extra;lld;llvm"
114114
)
115115
self.assertEqual(
116116
env_variables["project_check_targets"], "check-clang check-clang-tools"
117117
)
118-
self.assertEqual(env_variables["runtimes_to_build"], "")
118+
self.assertEqual(env_variables["runtimes_to_build"], "compiler-rt")
119119
self.assertEqual(
120120
env_variables["runtimes_check_targets"],
121-
"",
121+
"check-compiler-rt",
122122
)
123123
self.assertEqual(
124124
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -216,8 +216,8 @@ def test_flang(self):
216216
)
217217
self.assertEqual(env_variables["projects_to_build"], "clang;flang;llvm")
218218
self.assertEqual(env_variables["project_check_targets"], "check-flang")
219-
self.assertEqual(env_variables["runtimes_to_build"], "")
220-
self.assertEqual(env_variables["runtimes_check_targets"], "")
219+
self.assertEqual(env_variables["runtimes_to_build"], "flang-rt")
220+
self.assertEqual(env_variables["runtimes_check_targets"], "check-flang-rt")
221221
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
222222
self.assertEqual(env_variables["enable_cir"], "OFF")
223223

@@ -293,11 +293,11 @@ def test_ci(self):
293293
)
294294
self.assertEqual(
295295
env_variables["runtimes_to_build"],
296-
"compiler-rt;libc;libcxx;libcxxabi;libunwind",
296+
"compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind",
297297
)
298298
self.assertEqual(
299299
env_variables["runtimes_check_targets"],
300-
"check-compiler-rt check-libc",
300+
"check-compiler-rt check-flang-rt check-libc",
301301
)
302302
self.assertEqual(
303303
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -318,11 +318,11 @@ def test_windows_ci(self):
318318
)
319319
self.assertEqual(
320320
env_variables["runtimes_to_build"],
321-
"",
321+
"compiler-rt",
322322
)
323323
self.assertEqual(
324324
env_variables["runtimes_check_targets"],
325-
"",
325+
"check-compiler-rt",
326326
)
327327
self.assertEqual(
328328
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -367,11 +367,11 @@ def test_premerge_workflow(self):
367367
)
368368
self.assertEqual(
369369
env_variables["runtimes_to_build"],
370-
"compiler-rt;libc;libcxx;libcxxabi;libunwind",
370+
"compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind",
371371
)
372372
self.assertEqual(
373373
env_variables["runtimes_check_targets"],
374-
"check-compiler-rt check-libc",
374+
"check-compiler-rt check-flang-rt check-libc",
375375
)
376376
self.assertEqual(
377377
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -402,11 +402,11 @@ def test_third_party_benchmark(self):
402402
)
403403
self.assertEqual(
404404
env_variables["runtimes_to_build"],
405-
"compiler-rt;libc;libcxx;libcxxabi;libunwind",
405+
"compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind",
406406
)
407407
self.assertEqual(
408408
env_variables["runtimes_check_targets"],
409-
"check-compiler-rt check-libc",
409+
"check-compiler-rt check-flang-rt check-libc",
410410
)
411411
self.assertEqual(
412412
env_variables["runtimes_check_targets_needs_reconfig"],

.ci/generate_test_report_lib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
2727
# We hit the end of the log without finding a build failure, go to
2828
# the next log.
2929
return failures
30+
# If we are doing a build with LLVM_ENABLE_RUNTIMES, we can have nested
31+
# ninja invocations. The sub-ninja will print that a subcommand failed,
32+
# and then the outer ninja will list the command that failed. We should
33+
# ignore the outer failure.
34+
if ninja_log[index - 1].startswith("ninja: build stopped:"):
35+
index += 1
36+
continue
3037
# We are trying to parse cases like the following:
3138
#
3239
# [4/5] test/4.stamp

.ci/generate_test_report_lib_test.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,39 @@ def test_ninja_log_multiple_failures(self):
126126
),
127127
)
128128

129+
# Test that we can correctly handle the runtimes build. the LLVM runtimes
130+
# build will involve ninja invoking more ninja processes within the
131+
# runtimes directory. This means that we see two failures for a failure in
132+
# the runtimes build: one from the inner ninja containing the actual action
133+
# that failed, and one for the sub ninja invocation that failed.
134+
def test_ninja_log_runtimes_failure(self):
135+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
136+
[
137+
[
138+
"[1/5] test/1.stamp",
139+
"[2/5] test/2.stamp",
140+
"FAILED: touch test/2.stamp",
141+
"Wow! This system is really broken!",
142+
"ninja: build stopped: subcommand failed.",
143+
"FAILED: running check-runtime failed.",
144+
"<some random command>",
145+
"ninja: build stopped: subcommand failed.",
146+
]
147+
]
148+
)
149+
self.assertEqual(len(failures), 1)
150+
self.assertEqual(
151+
failures[0],
152+
(
153+
"test/2.stamp",
154+
dedent(
155+
"""\
156+
FAILED: touch test/2.stamp
157+
Wow! This system is really broken!"""
158+
),
159+
),
160+
)
161+
129162
def test_title_only(self):
130163
self.assertEqual(
131164
generate_test_report_lib.generate_report("Foo", 0, [], []),

.ci/monolithic-windows.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ source .ci/utils.sh
1717

1818
projects="${1}"
1919
targets="${2}"
20+
runtimes="${3}"
21+
runtimes_targets="${4}"
2022

2123
start-group "CMake"
2224
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
@@ -48,9 +50,14 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4850
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
4951
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
5052
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
51-
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
53+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
54+
-D LLVM_ENABLE_RUNTIMES="${runtimes}"
5255

5356
start-group "ninja"
5457

5558
# Targets are not escaped as they are passed as separate arguments.
5659
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
60+
61+
start-group "ninja runtimes"
62+
63+
ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log

.github/workflows/libcxx-build-containers.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3434

35+
# The default Docker storage location for GitHub Actions doesn't have
36+
# enough disk space, so change it to /mnt, which has more disk space.
37+
- name: Change Docker storage location
38+
run: |
39+
sudo mkdir /mnt/docker
40+
echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json
41+
sudo systemctl restart docker
42+
3543
- name: Build the Linux builder image
3644
working-directory: libcxx/utils/ci
3745
run: |
@@ -40,11 +48,11 @@ jobs:
4048
env:
4149
TAG: ${{ github.sha }}
4250

43-
# - name: Build the Android builder image
44-
# working-directory: libcxx/utils/ci
45-
# run: docker compose build android-buildkite-builder
46-
# env:
47-
# TAG: ${{ github.sha }}
51+
- name: Build the Android builder image
52+
working-directory: libcxx/utils/ci
53+
run: docker compose build android-buildkite-builder
54+
env:
55+
TAG: ${{ github.sha }}
4856

4957
- name: Log in to GitHub Container Registry
5058
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
@@ -62,10 +70,10 @@ jobs:
6270
env:
6371
TAG: ${{ github.sha }}
6472

65-
# - name: Push the Android builder image
66-
# if: github.event_name == 'push'
67-
# working-directory: libcxx/utils/ci
68-
# run: |
69-
# docker compose push android-buildkite-builder
70-
# env:
71-
# TAG: ${{ github.sha }}
73+
- name: Push the Android builder image
74+
if: github.event_name == 'push'
75+
working-directory: libcxx/utils/ci
76+
run: |
77+
docker compose push android-buildkite-builder
78+
env:
79+
TAG: ${{ github.sha }}

.github/workflows/pr-code-format.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ jobs:
5252
echo "Formatting files:"
5353
echo "$CHANGED_FILES"
5454
55+
# The clang format version should always be upgraded to the first version
56+
# of a release cycle (x.1.0) or the last version of a release cycle, or
57+
# if there have been relevant clang-format backports.
5558
- name: Install clang-format
5659
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
5760
with:
58-
clangformat: 20.1.8
61+
clangformat: 21.1.0
5962

6063
- name: Setup Python env
6164
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

.github/workflows/premerge.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,21 @@ jobs:
108108
109109
echo "Building projects: ${projects_to_build}"
110110
echo "Running project checks targets: ${project_check_targets}"
111+
echo "Building runtimes: ${runtimes_to_build}"
112+
echo "Running runtimes checks targets: ${runtimes_check_targets}"
111113
112114
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
113115
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
116+
echo "windows-runtimes=${runtimes_to_build}" >> $GITHUB_OUTPUT
117+
echo "windows-runtimes-check-targets=${runtimes_check_targets}" >> $GITHUB_OUTPUT
114118
- name: Build and Test
115119
if: ${{ steps.vars.outputs.windows-projects != '' }}
116120
shell: cmd
117121
run: |
118122
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
119123
# See the comments above in the Linux job for why we define each of
120124
# these environment variables.
121-
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; mkdir artifacts; SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
125+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; mkdir artifacts; SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\" \"${{ steps.vars.outputs.windows-runtimes }}\" \"${{ steps.vars.outputs.windows-runtimes-check-targets }}\""
122126
- name: Upload Artifacts
123127
# In some cases, Github will fail to upload the artifact. We want to
124128
# continue anyways as a failed artifact upload is an infra failure, not

bolt/lib/Core/BinaryContext.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,23 +1568,19 @@ unsigned BinaryContext::addDebugFilenameToUnit(const uint32_t DestCUID,
15681568
DWARFCompileUnit *SrcUnit = DwCtx->getCompileUnitForOffset(SrcCUID);
15691569
const DWARFDebugLine::LineTable *LineTable =
15701570
DwCtx->getLineTableForUnit(SrcUnit);
1571-
const std::vector<DWARFDebugLine::FileNameEntry> &FileNames =
1572-
LineTable->Prologue.FileNames;
1573-
// Dir indexes start at 1, as DWARF file numbers, and a dir index 0
1571+
const DWARFDebugLine::FileNameEntry &FileNameEntry =
1572+
LineTable->Prologue.getFileNameEntry(FileIndex);
1573+
// Dir indexes start at 1 and a dir index 0
15741574
// means empty dir.
1575-
assert(FileIndex > 0 && FileIndex <= FileNames.size() &&
1576-
"FileIndex out of range for the compilation unit.");
15771575
StringRef Dir = "";
1578-
if (FileNames[FileIndex - 1].DirIdx != 0) {
1576+
if (FileNameEntry.DirIdx != 0) {
15791577
if (std::optional<const char *> DirName = dwarf::toString(
1580-
LineTable->Prologue
1581-
.IncludeDirectories[FileNames[FileIndex - 1].DirIdx - 1])) {
1578+
LineTable->Prologue.IncludeDirectories[FileNameEntry.DirIdx - 1])) {
15821579
Dir = *DirName;
15831580
}
15841581
}
15851582
StringRef FileName = "";
1586-
if (std::optional<const char *> FName =
1587-
dwarf::toString(FileNames[FileIndex - 1].Name))
1583+
if (std::optional<const char *> FName = dwarf::toString(FileNameEntry.Name))
15881584
FileName = *FName;
15891585
assert(FileName != "");
15901586
DWARFCompileUnit *DstUnit = DwCtx->getCompileUnitForOffset(DestCUID);
@@ -1925,7 +1921,7 @@ static void printDebugInfo(raw_ostream &OS, const MCInst &Instruction,
19251921
const DWARFDebugLine::Row &Row = LineTable->Rows[RowRef.RowIndex - 1];
19261922
StringRef FileName = "";
19271923
if (std::optional<const char *> FName =
1928-
dwarf::toString(LineTable->Prologue.FileNames[Row.File - 1].Name))
1924+
dwarf::toString(LineTable->Prologue.getFileNameEntry(Row.File).Name))
19291925
FileName = *FName;
19301926
OS << " # debug line " << FileName << ":" << Row.Line;
19311927
if (Row.Column)

0 commit comments

Comments
 (0)