Skip to content

Commit 90cc60a

Browse files
committed
Merge remote-tracking branch 'tstellar/release-binary-upload' into HEAD
2 parents ddd1d1b + 868383e commit 90cc60a

File tree

578 files changed

+22838
-13030
lines changed

Some content is hidden

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

578 files changed

+22838
-13030
lines changed

.github/workflows/release-binaries.yml

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ jobs:
181181
needs: prepare
182182
if: github.repository_owner == 'llvm'
183183
runs-on: ${{ needs.prepare.outputs.build-runs-on }}
184+
outputs:
185+
digest: ${{ steps.digest.outputs.digest }}
186+
artifact-id: ${{ steps.artifact-upload.outputs.artifact-id }}
184187
steps:
185188

186189
- name: Checkout LLVM
@@ -215,8 +218,17 @@ jobs:
215218
ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
216219
release_dir=`find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname 'stage2-bins'`
217220
mv $release_dir/${{ needs.prepare.outputs.release-binary-filename }} .
218-
221+
222+
- name: Generate sha256 digest for binaries
223+
id: digest
224+
shell: bash
225+
env:
226+
RELEASE_BINARY_FILENAME: ${{ needs.prepare.outputs.release-binary-filename }}
227+
run: |
228+
echo "digest=$(cat $RELEASE_BINARY_FILENAME | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
229+
219230
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
231+
id: artifact-upload
220232
with:
221233
name: ${{ runner.os }}-${{ runner.arch }}-release-binary
222234
# Due to path differences on Windows when running in bash vs running on node,
@@ -249,41 +261,15 @@ jobs:
249261
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
250262
with:
251263
sparse-checkout: |
264+
.github/workflows/upload-release-artifact
252265
llvm/utils/release/github-upload-release.py
253266
llvm/utils/git/requirements.txt
254267
sparse-checkout-cone-mode: false
255268

256-
- name: 'Download artifact'
257-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
258-
with:
259-
pattern: '*-release-binary'
260-
merge-multiple: true
261-
262-
- name: Attest Build Provenance
263-
id: provenance
264-
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
265-
with:
266-
subject-path: ${{ needs.prepare.outputs.release-binary-filename }}
267-
268-
- name: Rename attestation file
269-
run:
270-
mv ${{ steps.provenance.outputs.bundle-path }} ${{ needs.prepare.outputs.release-binary-filename }}.jsonl
271-
272-
- name: Upload Build Provenance
273-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
274-
with:
275-
name: ${{ needs.prepare.outputs.release-binary-filename }}-attestation
276-
path: ${{ needs.prepare.outputs.release-binary-filename }}.jsonl
277-
278-
- name: Install Python Requirements
279-
run: |
280-
pip install --require-hashes -r ./llvm/utils/git/requirements.txt
281-
282-
- name: Upload Release
283-
shell: bash
284-
run: |
285-
./llvm/utils/release/github-upload-release.py \
286-
--token ${{ github.token }} \
287-
--release ${{ needs.prepare.outputs.release-version }} \
288-
upload \
289-
--files ${{ needs.prepare.outputs.release-binary-filename }}*
269+
- name: Upload Artifacts
270+
uses: ./.github/workflows/upload-release-artifact
271+
with:
272+
artifact-id: ${{ needs.build-release-package.outputs.artifact-id }}
273+
attestation-name: ${{ needs.prepare.outputs.release-binary-filename }}
274+
digest: ${{ needs.build-release-package.outputs.digest }}
275+
upload: true

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Checks: >
3232
-readability-qualified-auto,
3333
-readability-simplify-boolean-expr,
3434
-readability-static-definition-in-anonymous-namespace,
35-
-readability-suspicious-call-argument,
36-
-readability-use-anyofallof
35+
-readability-suspicious-call-argument
3736
3837
CheckOptions:
3938
- key: performance-move-const-arg.CheckTriviallyCopyableMove

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,10 @@ bool ClangTidyDiagnosticConsumer::passesLineFilter(StringRef FileName,
478478
if (FileName.ends_with(Filter.Name)) {
479479
if (Filter.LineRanges.empty())
480480
return true;
481-
for (const FileFilter::LineRange &Range : Filter.LineRanges) {
482-
if (Range.first <= LineNumber && LineNumber <= Range.second)
483-
return true;
484-
}
485-
return false;
481+
return llvm::any_of(
482+
Filter.LineRanges, [&](const FileFilter::LineRange &Range) {
483+
return Range.first <= LineNumber && LineNumber <= Range.second;
484+
});
486485
}
487486
}
488487
return false;

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ static bool isFallthroughSwitchBranch(const SwitchBranch &Branch) {
7575
if (!S)
7676
return true;
7777

78-
for (const Attr *A : S->getAttrs()) {
79-
if (isa<FallThroughAttr>(A))
80-
return false;
81-
}
82-
83-
return true;
78+
return llvm::all_of(S->getAttrs(), [](const Attr *A) {
79+
return !isa<FallThroughAttr>(A);
80+
});
8481
}
8582
} Visitor;
8683

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,17 @@ AST_MATCHER(CXXRecordDecl, correctHandleCaptureThisLambda) {
4444
if (Node.hasSimpleMoveAssignment())
4545
return false;
4646

47-
for (const CXXConstructorDecl *C : Node.ctors()) {
48-
if (C->isCopyOrMoveConstructor() && C->isDefaulted() && !C->isDeleted())
49-
return false;
50-
}
51-
for (const CXXMethodDecl *M : Node.methods()) {
52-
if (M->isCopyAssignmentOperator())
53-
llvm::errs() << M->isDeleted() << "\n";
54-
if (M->isCopyAssignmentOperator() && M->isDefaulted() && !M->isDeleted())
55-
return false;
56-
if (M->isMoveAssignmentOperator() && M->isDefaulted() && !M->isDeleted())
57-
return false;
58-
}
47+
if (llvm::any_of(Node.ctors(), [](const CXXConstructorDecl *C) {
48+
return C->isCopyOrMoveConstructor() && C->isDefaulted() &&
49+
!C->isDeleted();
50+
}))
51+
return false;
52+
if (llvm::any_of(Node.methods(), [](const CXXMethodDecl *M) {
53+
return (M->isCopyAssignmentOperator() ||
54+
M->isMoveAssignmentOperator()) &&
55+
M->isDefaulted() && !M->isDeleted();
56+
}))
57+
return false;
5958
// FIXME: find ways to identifier correct handle capture this lambda
6059
return true;
6160
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,11 +1589,9 @@ static bool lazyMapOfSetsIntersectionExists(const MapTy &Map, const ElemTy &E1,
15891589
if (E1Iterator == Map.end() || E2Iterator == Map.end())
15901590
return false;
15911591

1592-
for (const auto &E1SetElem : E1Iterator->second)
1593-
if (E2Iterator->second.contains(E1SetElem))
1594-
return true;
1595-
1596-
return false;
1592+
return llvm::any_of(E1Iterator->second, [&E2Iterator](const auto &E1SetElem) {
1593+
return E2Iterator->second.contains(E1SetElem);
1594+
});
15971595
}
15981596

15991597
/// Implements the heuristic that marks two parameters related if there is

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ void ExceptionEscapeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
7272

7373
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) {
7474
auto MatchIf = [](bool Enabled, const auto &Matcher) {
75-
ast_matchers::internal::Matcher<FunctionDecl> Nothing = unless(anything());
75+
const ast_matchers::internal::Matcher<FunctionDecl> Nothing =
76+
unless(anything());
7677
return Enabled ? Matcher : Nothing;
7778
};
7879
Finder->addMatcher(

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,9 @@ static bool isAtLeastOneCondVarChanged(const Decl *Func, const Stmt *LoopStmt,
119119
if (isVarThatIsPossiblyChanged(Func, LoopStmt, Cond, Context))
120120
return true;
121121

122-
for (const Stmt *Child : Cond->children()) {
123-
if (!Child)
124-
continue;
125-
126-
if (isAtLeastOneCondVarChanged(Func, LoopStmt, Child, Context))
127-
return true;
128-
}
129-
return false;
122+
return llvm::any_of(Cond->children(), [&](const Stmt *Child) {
123+
return Child && isAtLeastOneCondVarChanged(Func, LoopStmt, Child, Context);
124+
});
130125
}
131126

132127
/// Return the variable names in `Cond`.
@@ -240,10 +235,9 @@ static bool hasStaticLocalVariable(const Stmt *Cond) {
240235
return true;
241236
}
242237

243-
for (const Stmt *Child : Cond->children())
244-
if (Child && hasStaticLocalVariable(Child))
245-
return true;
246-
return false;
238+
return llvm::any_of(Cond->children(), [](const Stmt *Child) {
239+
return Child && hasStaticLocalVariable(Child);
240+
});
247241
}
248242

249243
/// Tests if the loop condition `Cond` involves static local variables and

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ class FindAssignToVarBefore
9292
return false;
9393
}
9494
bool VisitStmt(const Stmt *S) {
95-
for (const Stmt *Child : S->children())
96-
if (Child && Visit(Child))
97-
return true;
98-
return false;
95+
return llvm::any_of(S->children(), [this](const Stmt *Child) {
96+
return Child && Visit(Child);
97+
});
9998
}
10099
};
101100

clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ namespace clang::tidy::cppcoreguidelines {
1919
namespace {
2020
AST_MATCHER_P(CXXForRangeStmt, hasRangeBeginEndStmt,
2121
ast_matchers::internal::Matcher<DeclStmt>, InnerMatcher) {
22-
for (const DeclStmt *Stmt : {Node.getBeginStmt(), Node.getEndStmt()})
23-
if (Stmt != nullptr && InnerMatcher.matches(*Stmt, Finder, Builder))
24-
return true;
25-
return false;
22+
return llvm::any_of(llvm::ArrayRef{Node.getBeginStmt(), Node.getEndStmt()},
23+
[&](const DeclStmt *Stmt) {
24+
return Stmt &&
25+
InnerMatcher.matches(*Stmt, Finder, Builder);
26+
});
2627
}
2728

2829
AST_MATCHER(Stmt, isInsideOfRangeBeginEndStmt) {

0 commit comments

Comments
 (0)