Skip to content

Commit 3d0edd4

Browse files
committed
LLVM and SPIRV-LLVM-Translator pulldown (WW44)
LLVM: llvm/llvm-project@98da183 SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@a76f24e
2 parents d4221df + edd6656 commit 3d0edd4

File tree

3,113 files changed

+180204
-74537
lines changed

Some content is hidden

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

3,113 files changed

+180204
-74537
lines changed

.github/workflows/docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ on:
2121
- 'libcxx/docs/**'
2222
- 'libc/docs/**'
2323
- 'lld/docs/**'
24+
- 'openmp/docs/**'
25+
- 'polly/docs/**'
2426
pull_request:
2527
paths:
2628
- 'llvm/docs/**'
@@ -31,6 +33,8 @@ on:
3133
- 'libcxx/docs/**'
3234
- 'libc/docs/**'
3335
- 'lld/docs/**'
36+
- 'openmp/docs/**'
37+
- 'polly/docs/**'
3438

3539
jobs:
3640
check-docs-build:
@@ -67,6 +71,10 @@ jobs:
6771
- 'libc/docs/**'
6872
lld:
6973
- 'lld/docs/**'
74+
openmp:
75+
- 'openmp/docs/**'
76+
polly:
77+
- 'polly/docs/**'
7078
- name: Fetch LLVM sources (PR)
7179
if: ${{ github.event_name == 'pull_request' }}
7280
uses: actions/checkout@v4
@@ -125,4 +133,14 @@ jobs:
125133
run: |
126134
cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
127135
TZ=UTC ninja -C lld-build docs-lld-html
136+
- name: Build OpenMP docs
137+
if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
138+
run: |
139+
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
140+
TZ=UTC ninja -C openmp-build docs-openmp-html
141+
- name: Build Polly docs
142+
if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
143+
run: |
144+
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
145+
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
128146

.github/workflows/new-prs.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,36 @@
11
name: "Labelling new pull requests"
2+
3+
permissions:
4+
contents: read
5+
26
on:
3-
workflow_run:
4-
workflows: ["PR Receive"]
7+
# It's safe to use pull_request_target here, because we aren't checking out
8+
# code from the pull request branch.
9+
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
10+
pull_request_target:
11+
types:
12+
- opened
13+
- reopened
14+
- ready_for_review
15+
- synchronize
516

617
jobs:
718
automate-prs-labels:
819
permissions:
9-
contents: read
1020
pull-requests: write
1121
runs-on: ubuntu-latest
22+
# Ignore PRs with more than 10 commits. Pull requests with a lot of
23+
# commits tend to be accidents usually when someone made a mistake while trying
24+
# to rebase. We want to ignore these pull requests to avoid excessive
25+
# notifications.
1226
if: >
1327
github.repository == 'llvm/llvm-project' &&
14-
github.event.workflow_run.event == 'pull_request_target' &&
15-
github.event.workflow_run.conclusion == 'success'
28+
github.event.pull_request.draft == false &&
29+
github.event.pull_request.commits < 10
1630
steps:
17-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
18-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
19-
- name: Debug
20-
run: |
21-
echo "Event: ${{ github.event.workflow_run.event }} Conclusion: ${{ github.event.workflow_run.conclusion }}"
22-
- name: 'Download artifact'
23-
uses: actions/github-script@v6
24-
with:
25-
script: |
26-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
27-
owner: context.repo.owner,
28-
repo: context.repo.repo,
29-
run_id: context.payload.workflow_run.id
30-
});
31-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
32-
artifact.name === 'pr'
33-
);
34-
const download = await github.rest.actions.downloadArtifact({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
artifact_id: matchArtifact.id,
38-
archive_format: 'zip'
39-
});
40-
const { writeFileSync } = require('node:fs');
41-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
42-
43-
- run: unzip pr.zip
44-
45-
- name: "Get PR Number"
46-
id: vars
47-
run:
48-
echo "pr-number=$(cat NR)" >> "$GITHUB_OUTPUT"
49-
5031
- uses: actions/labeler@v4
5132
with:
5233
configuration-path: .github/new-prs-labeler.yml
5334
# workaround for https://github.com/actions/labeler/issues/112
5435
sync-labels: ''
5536
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
56-
pr-number: ${{ steps.vars.outputs.pr-number }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
- name: Fetch LLVM sources
1111
uses: actions/checkout@v4
1212
with:
13-
fetch-depth: 2
13+
fetch-depth: 2 # Fetches only the last 2 commits
1414

1515
- name: Get changed files
1616
id: changed-files
1717
uses: tj-actions/changed-files@v39
1818
with:
1919
separator: ","
20-
fetch_depth: 100 # Fetches only the last 10 commits
20+
fetch_depth: 2000 # Fetches only the last 2000 commits
2121

2222
- name: "Listed files"
2323
run: |

.github/workflows/pr-receive-label.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/pr-receive.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/pr-subscriber-wait.py

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
name: PR Subscriber
22

33
on:
4-
workflow_run:
5-
workflows: ["PR Receive Label"]
4+
pull_request_target:
65
types:
7-
- completed
6+
- labeled
87

98
permissions:
10-
actions: read
119
contents: read
1210

1311
jobs:
1412
auto-subscribe:
1513
runs-on: ubuntu-latest
16-
if: >
17-
github.repository == 'llvm/llvm-project' &&
18-
github.event.workflow_run.event == 'pull_request' &&
19-
github.event.workflow_run.conclusion == 'success'
14+
if: github.repository == 'llvm/llvm-project'
2015
steps:
2116
- name: Setup Automation Script
2217
run: |
@@ -26,47 +21,10 @@ jobs:
2621
chmod a+x github-automation.py
2722
pip install -r requirements.txt
2823
29-
- name: 'Wait for other actions'
30-
# We can't use the concurrency tag for these jobs, because it will
31-
# cancel pending jobs if another job is running.
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
run: |
35-
python3 pr-subscriber-wait.py
36-
37-
38-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
39-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
40-
- name: 'Download artifact'
41-
uses: actions/github-script@v6
42-
with:
43-
script: |
44-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
45-
owner: context.repo.owner,
46-
repo: context.repo.repo,
47-
run_id: context.payload.workflow_run.id
48-
});
49-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
50-
artifact.name === 'pr'
51-
);
52-
const download = await github.rest.actions.downloadArtifact({
53-
owner: context.repo.owner,
54-
repo: context.repo.repo,
55-
artifact_id: matchArtifact.id,
56-
archive_format: 'zip'
57-
});
58-
const { writeFileSync } = require('node:fs');
59-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
60-
61-
- run: unzip pr.zip
62-
6324
- name: Update watchers
64-
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
6525
run: |
66-
PR_NUMBER=$(cat NR)
67-
LABEL_NAME=$(cat LABEL)
6826
./github-automation.py \
6927
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
7028
pr-subscriber \
71-
--issue-number "$PR_NUMBER" \
72-
--label-name "$LABEL_NAME"
29+
--issue-number "${{ github.event.number }}" \
30+
--label-name "${{ github.event.label.name }}"

.github/workflows/scorecard.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
# Check current LLVM-Project results here: https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project
6+
7+
name: Scorecard supply-chain security
8+
on:
9+
# For Branch-Protection check. Only the default branch is supported. See
10+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
11+
branch_protection_rule:
12+
# To guarantee Maintained check is occasionally updated. See
13+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
14+
schedule:
15+
- cron: '38 20 * * *'
16+
17+
# Declare default permissions as read only.
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
analysis:
23+
name: Scorecard analysis
24+
runs-on: ubuntu-latest
25+
permissions:
26+
# Needed to upload the results to code-scanning dashboard.
27+
security-events: write
28+
# Needed to publish results and get a badge (see publish_results below).
29+
id-token: write
30+
31+
steps:
32+
- name: "Checkout code"
33+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
34+
with:
35+
persist-credentials: false
36+
37+
- name: "Run analysis"
38+
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
39+
with:
40+
results_file: results.sarif
41+
results_format: sarif
42+
43+
# - Publish results to OpenSSF REST API for easy access by consumers
44+
# - Allows the repository to include the Scorecard badge.
45+
# - See https://github.com/ossf/scorecard-action#publishing-results.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard.
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
60+
with:
61+
sarif_file: results.sarif

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,20 @@ handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle,
3333

3434
ast_matchers::internal::Matcher<Stmt> handleFromTemporaryValue(
3535
const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) {
36+
37+
const auto TemporaryExpr = anyOf(
38+
cxxBindTemporaryExpr(),
39+
cxxFunctionalCastExpr(
40+
hasCastKind(CK_ConstructorConversion),
41+
hasSourceExpression(ignoringParenImpCasts(cxxBindTemporaryExpr()))));
3642
// If a ternary operator returns a temporary value, then both branches hold a
3743
// temporary value. If one of them is not a temporary then it must be copied
3844
// into one to satisfy the type of the operator.
3945
const auto TemporaryTernary = conditionalOperator(
40-
hasTrueExpression(ignoringParenImpCasts(cxxBindTemporaryExpr())),
41-
hasFalseExpression(ignoringParenImpCasts(cxxBindTemporaryExpr())));
46+
hasTrueExpression(ignoringParenImpCasts(TemporaryExpr)),
47+
hasFalseExpression(ignoringParenImpCasts(TemporaryExpr)));
4248

43-
return handleFrom(IsAHandle, anyOf(cxxBindTemporaryExpr(), TemporaryTernary));
49+
return handleFrom(IsAHandle, anyOf(TemporaryExpr, TemporaryTernary));
4450
}
4551

4652
ast_matchers::internal::Matcher<RecordDecl> isASequence() {

0 commit comments

Comments
 (0)