Skip to content

Commit 79b5cf3

Browse files
committed
Merge branch 'main' of https://github.com/llvm/llvm-project into fix/93512
2 parents da4df73 + ef01c75 commit 79b5cf3

File tree

4,038 files changed

+348327
-94065
lines changed

Some content is hidden

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

4,038 files changed

+348327
-94065
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function compute-projects-to-test() {
7474
fi
7575
;;
7676
clang)
77-
for p in clang-tools-extra compiler-rt lldb cross-project-tests; do
77+
# lldb is temporarily removed to alleviate Linux pre-commit CI waiting times
78+
for p in clang-tools-extra compiler-rt cross-project-tests; do
7879
echo $p
7980
done
8081
;;
@@ -153,7 +154,6 @@ function exclude-linux() {
153154
for project in ${projects}; do
154155
case ${project} in
155156
cross-project-tests) ;; # tests failing
156-
lldb) ;; # tests failing
157157
openmp) ;; # https://github.com/google/llvm-premerge-checks/issues/410
158158
*)
159159
echo "${project}"
@@ -170,7 +170,7 @@ function exclude-windows() {
170170
compiler-rt) ;; # tests taking too long
171171
openmp) ;; # TODO: having trouble with the Perl installation
172172
libc) ;; # no Windows support
173-
lldb) ;; # tests failing
173+
lldb) ;; # custom environment requirements (https://github.com/llvm/llvm-project/pull/94208#issuecomment-2146256857)
174174
bolt) ;; # tests are not supported yet
175175
*)
176176
echo "${project}"
@@ -213,7 +213,7 @@ function check-targets() {
213213
echo "check-unwind"
214214
;;
215215
lldb)
216-
echo "check-all" # TODO: check-lldb may not include all the LLDB tests?
216+
echo "check-lldb"
217217
;;
218218
pstl)
219219
echo "check-all"

.ci/monolithic-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ targets="${2}"
3939

4040
echo "--- cmake"
4141
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
42+
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
4243
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4344
-D LLVM_ENABLE_PROJECTS="${projects}" \
4445
-G Ninja \
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import json
2+
import multiprocessing
3+
import os
4+
import re
5+
import subprocess
6+
import sys
7+
8+
9+
def run_analyzer(data):
10+
os.chdir(data["directory"])
11+
command = (
12+
data["command"]
13+
+ f" --analyze --analyzer-output html -o analyzer-results -Xclang -analyzer-config -Xclang max-nodes=75000"
14+
)
15+
print(command)
16+
subprocess.run(command, shell=True, check=True)
17+
18+
19+
def pool_error(e):
20+
print("Error analyzing file:", e)
21+
22+
23+
def main():
24+
db_path = sys.argv[1]
25+
database = json.load(open(db_path))
26+
27+
with multiprocessing.Pool() as pool:
28+
pool.map_async(run_analyzer, [k for k in database], error_callback=pool_error)
29+
pool.close()
30+
pool.join()
31+
32+
33+
if __name__ == "__main__":
34+
main()
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Post-Commit Static Analyzer
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- 'release/**'
10+
paths:
11+
- 'clang/**'
12+
- 'llvm/**'
13+
- '.github/workflows/ci-post-commit-analyzer.yml'
14+
pull_request:
15+
types:
16+
- opened
17+
- synchronize
18+
- reopened
19+
- closed
20+
paths:
21+
- '.github/workflows/ci-post-commit-analyzer.yml'
22+
- '.github/workflows/ci-post-commit-analyzer-run.py'
23+
schedule:
24+
- cron: '30 0 * * *'
25+
26+
concurrency:
27+
group: >-
28+
llvm-project-${{ github.workflow }}-${{ github.event_name == 'pull_request' &&
29+
( github.event.pull_request.number || github.ref) }}
30+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
31+
32+
jobs:
33+
post-commit-analyzer:
34+
if: >-
35+
github.repository_owner == 'llvm' &&
36+
github.event.action != 'closed'
37+
runs-on: ubuntu-22.04
38+
container:
39+
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest'
40+
env:
41+
LLVM_VERSION: 18
42+
steps:
43+
- name: Checkout Source
44+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
46+
- name: Setup ccache
47+
uses: hendrikmuhs/ccache-action@v1
48+
with:
49+
# A full build of llvm, clang, lld, and lldb takes about 250MB
50+
# of ccache space. There's not much reason to have more than this,
51+
# because we usually won't need to save cache entries from older
52+
# builds. Also, there is an overall 10GB cache limit, and each
53+
# run creates a new cache entry so we want to ensure that we have
54+
# enough cache space for all the tests to run at once and still
55+
# fit under the 10 GB limit.
56+
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
57+
max-size: 2G
58+
key: post-commit-analyzer
59+
variant: sccache
60+
61+
- name: Configure
62+
run: |
63+
cmake -B build -S llvm -G Ninja \
64+
-DLLVM_ENABLE_ASSERTIONS=ON \
65+
-DLLVM_ENABLE_PROJECTS=clang \
66+
-DLLVM_BUILD_LLVM_DYLIB=ON \
67+
-DLLVM_LINK_LLVM_DYLIB=ON \
68+
-DCMAKE_CXX_COMPILER=clang++ \
69+
-DCMAKE_C_COMPILER=clang \
70+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
71+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
72+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
73+
-DLLVM_INCLUDE_TESTS=OFF \
74+
-DCLANG_INCLUDE_TESTS=OFF \
75+
-DCMAKE_BUILD_TYPE=Release
76+
77+
- name: Build
78+
run: |
79+
# FIXME: We need to build all the generated header files in order to be able to run
80+
# the analyzer on every file. Building libLLVM and libclang is probably overkill for
81+
# this, but it's better than building every target.
82+
ninja -v -C build libLLVM.so libclang.so
83+
84+
# Run the analyzer.
85+
python3 .github/workflows/ci-post-commit-analyzer-run.py build/compile_commands.json
86+
87+
scan-build --generate-index-only build/analyzer-results
88+
89+
- name: Upload Results
90+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
91+
if: always()
92+
with:
93+
name: analyzer-results
94+
path: 'build/analyzer-results/*'
95+

.github/workflows/containers/github-action-ci/stage1.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
3737
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
3838
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
3939
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
40-
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
40+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build" \
4141
-DCLANG_DEFAULT_LINKER="lld" \
4242
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=/llvm-project-llvmorg-$LLVM_VERSION/llvm
4343

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
with:
101101
fetch-depth: 1
102102
- name: Setup Python env
103-
uses: actions/setup-python@v4
103+
uses: actions/setup-python@v5
104104
with:
105105
python-version: '3.11'
106106
cache: 'pip'

.github/workflows/libclang-python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
python-version: ["3.7", "3.11"]
39+
python-version: ["3.8", "3.11"]
4040
uses: ./.github/workflows/llvm-project-tests.yml
4141
with:
4242
build_target: check-clang-python

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ jobs:
209209
- uses: actions/checkout@v4
210210
- name: Install dependencies
211211
run: |
212-
choco install -y ninja wget
212+
choco install -y ninja
213213
pip install psutil
214214
- name: Install a current LLVM
215215
if: ${{ matrix.mingw != true }}
216216
run: |
217-
choco install -y llvm --version=17.0.6
217+
choco install -y llvm --version=18.1.6 --allow-downgrade
218218
- name: Install llvm-mingw
219219
if: ${{ matrix.mingw == true }}
220220
run: |
221-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
221+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-ucrt-x86_64.zip
222222
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
223223
del llvm-mingw*.zip
224224
mv llvm-mingw* c:\llvm-mingw

.github/workflows/restart-preempted-libcxx-jobs.yaml renamed to .github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
script: |
3535
const failure_regex = /Process completed with exit code 1./
3636
const preemption_regex = /The runner has received a shutdown signal/
37-
37+
3838
const wf_run = context.payload.workflow_run
3939
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
4040
@@ -80,30 +80,30 @@ jobs:
8080
}
8181
check_run_ids.push(check_run.id);
8282
}
83-
83+
8484
has_preempted_job = false;
8585
8686
for (check_run_id of check_run_ids) {
8787
console.log('Listing annotations for check run: ' + check_run_id);
88-
88+
8989
annotations = await github.rest.checks.listAnnotations({
9090
owner: context.repo.owner,
9191
repo: context.repo.repo,
9292
check_run_id: check_run_id
9393
})
94-
94+
9595
for (annotation of annotations.data) {
9696
if (annotation.annotation_level != 'failure') {
9797
continue;
9898
}
99-
99+
100100
const preemption_match = annotation.message.match(preemption_regex);
101-
101+
102102
if (preemption_match != null) {
103103
console.log('Found preemption message: ' + annotation.message);
104104
has_preempted_job = true;
105105
}
106-
106+
107107
const failure_match = annotation.message.match(failure_regex);
108108
if (failure_match != null) {
109109
// We only want to restart the workflow if all of the failures were due to preemption.
@@ -115,20 +115,18 @@ jobs:
115115
return;
116116
}
117117
}
118-
}
119-
118+
}
119+
120120
if (!has_preempted_job) {
121121
core.notice('No preempted jobs found. Not restarting workflow.');
122122
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
123123
return;
124124
}
125-
125+
126126
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
127127
await github.rest.actions.reRunWorkflowFailedJobs({
128128
owner: context.repo.owner,
129129
repo: context.repo.repo,
130130
run_id: context.payload.workflow_run.id
131131
})
132132
await create_check_run('success', 'Restarted workflow run due to preempted job')
133-
134-

.github/workflows/llvm-project-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
# lldb. Using this setup-python action to make 3.10 the default
7878
# python fixes this.
7979
- name: Setup Python
80-
uses: actions/setup-python@v4
80+
uses: actions/setup-python@v5
8181
with:
8282
python-version: ${{ inputs.python_version }}
8383
- name: Install Ninja

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
clangformat: 18.1.1
5959

6060
- name: Setup Python env
61-
uses: actions/setup-python@v4
61+
uses: actions/setup-python@v5
6262
with:
6363
python-version: '3.11'
6464
cache: 'pip'

.github/workflows/release-binaries.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ jobs:
156156
rm build.tar.zst
157157
158158
- name: Build Stage 2
159+
# Re-enable once PGO builds are supported.
160+
if: false
159161
run: |
160162
ninja -C /mnt/build stage2-instrumented
161163
@@ -214,7 +216,7 @@ jobs:
214216
215217
- id: package-info
216218
run: |
217-
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.gz"
219+
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.xz"
218220
echo "filename=$filename" >> $GITHUB_OUTPUT
219221
echo "path=/mnt/build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
220222

.github/workflows/release-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3838

3939
- name: Setup Python env
40-
uses: actions/setup-python@v4
40+
uses: actions/setup-python@v5
4141
with:
4242
cache: 'pip'
4343
cache-dependency-path: './llvm/docs/requirements.txt'

.github/workflows/release-doxygen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4040

4141
- name: Setup Python env
42-
uses: actions/setup-python@v4
42+
uses: actions/setup-python@v5
4343
with:
4444
cache: 'pip'
4545
cache-dependency-path: './llvm/docs/requirements.txt'

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,9 @@ class DIEBuilder {
215215
/// Along with current CU, and DIE being processed and the new DIE offset to
216216
/// be updated, it takes in Parents vector that can be empty if this DIE has
217217
/// no parents.
218-
uint32_t
219-
finalizeDIEs(DWARFUnit &CU, DIE &Die,
220-
std::vector<std::optional<BOLTDWARF5AccelTableData *>> &Parents,
221-
uint32_t &CurOffset);
218+
uint32_t finalizeDIEs(DWARFUnit &CU, DIE &Die,
219+
std::optional<BOLTDWARF5AccelTableData *> Parent,
220+
uint32_t NumberParentsInChain, uint32_t &CurOffset);
222221

223222
void registerUnit(DWARFUnit &DU, bool NeedSort);
224223

bolt/include/bolt/Core/DebugNames.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,25 @@ class BOLTDWARF5AccelTableData : public DWARF5AccelTableData {
2424
BOLTDWARF5AccelTableData(const uint64_t DieOffset,
2525
const std::optional<uint64_t> DefiningParentOffset,
2626
const unsigned DieTag, const unsigned UnitID,
27-
const bool IsTU,
27+
const bool IsParentRoot, const bool IsTU,
2828
const std::optional<unsigned> SecondUnitID)
2929
: DWARF5AccelTableData(DieOffset, DefiningParentOffset, DieTag, UnitID,
3030
IsTU),
31-
SecondUnitID(SecondUnitID) {}
31+
SecondUnitID(SecondUnitID), IsParentRoot(IsParentRoot) {}
3232

3333
uint64_t getDieOffset() const { return DWARF5AccelTableData::getDieOffset(); }
3434
unsigned getDieTag() const { return DWARF5AccelTableData::getDieTag(); }
3535
unsigned getUnitID() const { return DWARF5AccelTableData::getUnitID(); }
3636
bool isTU() const { return DWARF5AccelTableData::isTU(); }
37+
bool isParentRoot() const { return IsParentRoot; }
3738
std::optional<unsigned> getSecondUnitID() const { return SecondUnitID; }
3839

3940
void setPatchOffset(uint64_t PatchOffset) { OffsetVal = PatchOffset; }
4041
uint64_t getPatchOffset() const { return std::get<uint64_t>(OffsetVal); }
4142

4243
private:
4344
std::optional<unsigned> SecondUnitID;
45+
bool IsParentRoot;
4446
};
4547

4648
class DWARF5AcceleratorTable {
@@ -57,6 +59,7 @@ class DWARF5AcceleratorTable {
5759
std::optional<BOLTDWARF5AccelTableData *>
5860
addAccelTableEntry(DWARFUnit &Unit, const DIE &Die,
5961
const std::optional<uint64_t> &DWOID,
62+
const uint32_t NumberParentsInChain,
6063
std::optional<BOLTDWARF5AccelTableData *> &Parent);
6164
/// Set current unit being processed.
6265
void setCurrentUnit(DWARFUnit &Unit, const uint64_t UnitStartOffset);

0 commit comments

Comments
 (0)