Skip to content

Commit 61ef809

Browse files
authored
Merge branch 'main' into 20251017-fix-gfx11-wmma
2 parents 5dc29c2 + 8b74582 commit 61ef809

File tree

416 files changed

+97418
-4539
lines changed

Some content is hidden

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

416 files changed

+97418
-4539
lines changed

.github/workflows/premerge.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
with:
6363
fetch-depth: 2
6464
- name: Build and Test
65+
timeout-minutes: 120
6566
continue-on-error: ${{ runner.arch == 'ARM64' }}
6667
run: |
6768
git config --global --add safe.directory '*'
@@ -149,6 +150,7 @@ jobs:
149150
echo "windows-runtimes=${runtimes_to_build}" >> $GITHUB_OUTPUT
150151
echo "windows-runtimes-check-targets=${runtimes_check_targets}" >> $GITHUB_OUTPUT
151152
- name: Build and Test
153+
timeout-minutes: 180
152154
if: ${{ steps.vars.outputs.windows-projects != '' }}
153155
shell: cmd
154156
run: |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ template <> struct ScalarEnumerationTraits<clang::DiagnosticIDs::Level> {
154154
}
155155
};
156156
template <> struct SequenceElementTraits<ClangTidyOptions::CustomCheckDiag> {
157+
// NOLINTNEXTLINE(readability-identifier-naming) Defined by YAMLTraits.h
157158
static const bool flow = false;
158159
};
159160
template <> struct MappingTraits<ClangTidyOptions::CustomCheckDiag> {
@@ -165,6 +166,7 @@ template <> struct MappingTraits<ClangTidyOptions::CustomCheckDiag> {
165166
}
166167
};
167168
template <> struct SequenceElementTraits<ClangTidyOptions::CustomCheckValue> {
169+
// NOLINTNEXTLINE(readability-identifier-naming) Defined by YAMLTraits.h
168170
static const bool flow = false;
169171
};
170172
template <> struct MappingTraits<ClangTidyOptions::CustomCheckValue> {

clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ struct StrCatCheckResult {
4545
std::vector<FixItHint> Hints;
4646
};
4747

48-
void removeCallLeaveArgs(const CallExpr *Call, StrCatCheckResult *CheckResult) {
48+
} // namespace
49+
50+
static void removeCallLeaveArgs(const CallExpr *Call,
51+
StrCatCheckResult *CheckResult) {
4952
if (Call->getNumArgs() == 0)
5053
return;
5154
// Remove 'Foo('
@@ -58,9 +61,9 @@ void removeCallLeaveArgs(const CallExpr *Call, StrCatCheckResult *CheckResult) {
5861
Call->getRParenLoc(), Call->getEndLoc().getLocWithOffset(1))));
5962
}
6063

61-
const clang::CallExpr *processArgument(const Expr *Arg,
62-
const MatchFinder::MatchResult &Result,
63-
StrCatCheckResult *CheckResult) {
64+
static const clang::CallExpr *
65+
processArgument(const Expr *Arg, const MatchFinder::MatchResult &Result,
66+
StrCatCheckResult *CheckResult) {
6467
const auto IsAlphanum = hasDeclaration(cxxMethodDecl(hasName("AlphaNum")));
6568
static const auto *const Strcat = new auto(hasName("::absl::StrCat"));
6669
const auto IsStrcat = cxxBindTemporaryExpr(
@@ -78,8 +81,8 @@ const clang::CallExpr *processArgument(const Expr *Arg,
7881
return nullptr;
7982
}
8083

81-
StrCatCheckResult processCall(const CallExpr *RootCall, bool IsAppend,
82-
const MatchFinder::MatchResult &Result) {
84+
static StrCatCheckResult processCall(const CallExpr *RootCall, bool IsAppend,
85+
const MatchFinder::MatchResult &Result) {
8386
StrCatCheckResult CheckResult;
8487
std::deque<const CallExpr *> CallsToProcess = {RootCall};
8588

@@ -101,7 +104,6 @@ StrCatCheckResult processCall(const CallExpr *RootCall, bool IsAppend,
101104
}
102105
return CheckResult;
103106
}
104-
} // namespace
105107

106108
void RedundantStrcatCallsCheck::check(const MatchFinder::MatchResult &Result) {
107109
bool IsAppend = false;

clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ bool UnrollLoopsCheck::hasLargeNumIterations(const Stmt *Statement,
215215
break;
216216
case (BO_MulAssign):
217217
Iterations =
218-
1 + (std::log((double)EndValue) - std::log((double)InitValue)) /
219-
std::log((double)ConstantValue);
218+
1 + ((std::log((double)EndValue) - std::log((double)InitValue)) /
219+
std::log((double)ConstantValue));
220220
break;
221221
case (BO_DivAssign):
222222
Iterations =
223-
1 + (std::log((double)InitValue) - std::log((double)EndValue)) /
224-
std::log((double)ConstantValue);
223+
1 + ((std::log((double)InitValue) - std::log((double)EndValue)) /
224+
std::log((double)ConstantValue));
225225
break;
226226
default:
227227
// All other operators are not handled; assume large bounds.

clang-tools-extra/clang-tidy/android/CloexecCheck.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ using namespace clang::ast_matchers;
1616

1717
namespace clang::tidy::android {
1818

19-
namespace {
2019
// Helper function to form the correct string mode for Type3.
2120
// Build the replace text. If it's string constant, add <Mode> directly in the
2221
// end of the string. Else, add <Mode>.
23-
std::string buildFixMsgForStringFlag(const Expr *Arg, const SourceManager &SM,
24-
const LangOptions &LangOpts, char Mode) {
22+
static std::string buildFixMsgForStringFlag(const Expr *Arg,
23+
const SourceManager &SM,
24+
const LangOptions &LangOpts,
25+
char Mode) {
2526
if (Arg->getBeginLoc().isMacroID())
2627
return (Lexer::getSourceText(
2728
CharSourceRange::getTokenRange(Arg->getSourceRange()), SM,
@@ -32,11 +33,6 @@ std::string buildFixMsgForStringFlag(const Expr *Arg, const SourceManager &SM,
3233
StringRef SR = cast<StringLiteral>(Arg->IgnoreParenCasts())->getString();
3334
return ("\"" + SR + Twine(Mode) + "\"").str();
3435
}
35-
} // namespace
36-
37-
const char *CloexecCheck::FuncDeclBindingStr = "funcDecl";
38-
39-
const char *CloexecCheck::FuncBindingStr = "func";
4036

4137
void CloexecCheck::registerMatchersImpl(
4238
MatchFinder *Finder, internal::Matcher<FunctionDecl> Function) {

clang-tools-extra/clang-tidy/android/CloexecCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ class CloexecCheck : public ClangTidyCheck {
8989
int N) const;
9090

9191
/// Binding name of the FuncDecl of a function call.
92-
static const char *FuncDeclBindingStr;
92+
static constexpr char FuncDeclBindingStr[] = "funcDecl";
9393

9494
/// Binding name of the function call expression.
95-
static const char *FuncBindingStr;
95+
static constexpr char FuncBindingStr[] = "func";
9696
};
9797

9898
} // namespace clang::tidy::android

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ approximateStandardConversionSequence(const TheCheck &Check, QualType From,
10741074
WorkType = To;
10751075
}
10761076

1077-
if (Ctx.hasSameType(WorkType, To)) {
1077+
if (ASTContext::hasSameType(WorkType, To)) {
10781078
LLVM_DEBUG(llvm::dbgs() << "<<< approximateStdConv. Reached 'To' type.\n");
10791079
return {Ctx.getCommonSugaredType(WorkType, To)};
10801080
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ namespace {
1818

1919
AST_MATCHER(Expr, isInMacro) { return Node.getBeginLoc().isMacroID(); }
2020

21+
} // namespace
22+
2123
/// Find the next statement after `S`.
22-
const Stmt *nextStmt(const MatchFinder::MatchResult &Result, const Stmt *S) {
24+
static const Stmt *nextStmt(const MatchFinder::MatchResult &Result,
25+
const Stmt *S) {
2326
auto Parents = Result.Context->getParents(*S);
2427
if (Parents.empty())
2528
return nullptr;
@@ -40,8 +43,8 @@ using ExpansionRanges = std::vector<SourceRange>;
4043
/// \brief Get all the macro expansion ranges related to `Loc`.
4144
///
4245
/// The result is ordered from most inner to most outer.
43-
ExpansionRanges getExpansionRanges(SourceLocation Loc,
44-
const MatchFinder::MatchResult &Result) {
46+
static ExpansionRanges
47+
getExpansionRanges(SourceLocation Loc, const MatchFinder::MatchResult &Result) {
4548
ExpansionRanges Locs;
4649
while (Loc.isMacroID()) {
4750
Locs.push_back(
@@ -51,8 +54,6 @@ ExpansionRanges getExpansionRanges(SourceLocation Loc,
5154
return Locs;
5255
}
5356

54-
} // namespace
55-
5657
void MultipleStatementMacroCheck::registerMatchers(MatchFinder *Finder) {
5758
const auto Inner = expr(isInMacro(), unless(compoundStmt())).bind("inner");
5859
Finder->addMatcher(

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,10 @@ struct OptionEnumMapping<
245245

246246
namespace bugprone {
247247

248-
namespace {
249-
250248
/// Returns if a function is declared inside a system header.
251249
/// These functions are considered to be "standard" (system-provided) library
252250
/// functions.
253-
bool isStandardFunction(const FunctionDecl *FD) {
251+
static bool isStandardFunction(const FunctionDecl *FD) {
254252
// Find a possible redeclaration in system header.
255253
// FIXME: Looking at the canonical declaration is not the most exact way
256254
// to do this.
@@ -284,7 +282,7 @@ bool isStandardFunction(const FunctionDecl *FD) {
284282
/// Check if a statement is "C++-only".
285283
/// This includes all statements that have a class name with "CXX" prefix
286284
/// and every other statement that is declared in file ExprCXX.h.
287-
bool isCXXOnlyStmt(const Stmt *S) {
285+
static bool isCXXOnlyStmt(const Stmt *S) {
288286
StringRef Name = S->getStmtClassName();
289287
if (Name.starts_with("CXX"))
290288
return true;
@@ -304,7 +302,8 @@ bool isCXXOnlyStmt(const Stmt *S) {
304302
/// called from \p Caller, get a \c CallExpr of the corresponding function call.
305303
/// It is unspecified which call is found if multiple calls exist, but the order
306304
/// should be deterministic (depend only on the AST).
307-
Expr *findCallExpr(const CallGraphNode *Caller, const CallGraphNode *Callee) {
305+
static Expr *findCallExpr(const CallGraphNode *Caller,
306+
const CallGraphNode *Callee) {
308307
const auto *FoundCallee = llvm::find_if(
309308
Caller->callees(), [Callee](const CallGraphNode::CallRecord &Call) {
310309
return Call.Callee == Callee;
@@ -314,7 +313,7 @@ Expr *findCallExpr(const CallGraphNode *Caller, const CallGraphNode *Callee) {
314313
return FoundCallee->CallExpr;
315314
}
316315

317-
SourceRange getSourceRangeOfStmt(const Stmt *S, ASTContext &Ctx) {
316+
static SourceRange getSourceRangeOfStmt(const Stmt *S, ASTContext &Ctx) {
318317
ParentMapContext &PM = Ctx.getParentMapContext();
319318
DynTypedNode P = DynTypedNode::create(*S);
320319
while (P.getSourceRange().isInvalid()) {
@@ -326,9 +325,9 @@ SourceRange getSourceRangeOfStmt(const Stmt *S, ASTContext &Ctx) {
326325
return P.getSourceRange();
327326
}
328327

329-
AST_MATCHER(FunctionDecl, isStandardFunction) {
330-
return isStandardFunction(&Node);
331-
}
328+
namespace {
329+
330+
AST_MATCHER(FunctionDecl, isStandard) { return isStandardFunction(&Node); }
332331

333332
} // namespace
334333

@@ -354,7 +353,7 @@ bool SignalHandlerCheck::isLanguageVersionSupported(
354353

355354
void SignalHandlerCheck::registerMatchers(MatchFinder *Finder) {
356355
auto SignalFunction = functionDecl(hasAnyName("::signal", "::std::signal"),
357-
parameterCountIs(2), isStandardFunction());
356+
parameterCountIs(2), isStandard());
358357
auto HandlerExpr =
359358
declRefExpr(hasDeclaration(functionDecl().bind("handler_decl")),
360359
unless(isExpandedFromMacro("SIG_IGN")),

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
424424
"suspicious usage of 'sizeof(array)/sizeof(...)';"
425425
" denominator differs from the size of array elements")
426426
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
427-
} else if (NumTy && DenomTy && Ctx.hasSameType(NumTy, DenomTy) &&
427+
} else if (NumTy && DenomTy && ASTContext::hasSameType(NumTy, DenomTy) &&
428428
!NumTy->isDependentType()) {
429429
// Dependent type should not be compared.
430430
diag(E->getOperatorLoc(),
@@ -433,7 +433,7 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
433433
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
434434
} else if (!WarnOnSizeOfPointer) {
435435
// When 'WarnOnSizeOfPointer' is enabled, these messages become redundant:
436-
if (PointedTy && DenomTy && Ctx.hasSameType(PointedTy, DenomTy)) {
436+
if (PointedTy && DenomTy && ASTContext::hasSameType(PointedTy, DenomTy)) {
437437
diag(E->getOperatorLoc(),
438438
"suspicious usage of 'sizeof(...)/sizeof(...)'; size of pointer "
439439
"is divided by size of pointed type")
@@ -462,8 +462,8 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
462462
const auto *SizeOfExpr =
463463
Result.Nodes.getNodeAs<UnaryExprOrTypeTraitExpr>("sizeof-ptr-mul-expr");
464464

465-
if (Ctx.hasSameType(LPtrTy, RPtrTy) &&
466-
Ctx.hasSameType(LPtrTy, SizeofArgTy)) {
465+
if (ASTContext::hasSameType(LPtrTy, RPtrTy) &&
466+
ASTContext::hasSameType(LPtrTy, SizeofArgTy)) {
467467
diag(SizeOfExpr->getBeginLoc(), "suspicious usage of 'sizeof(...)' in "
468468
"pointer arithmetic")
469469
<< SizeOfExpr->getSourceRange() << E->getOperatorLoc()
@@ -477,8 +477,8 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
477477
const auto *SizeOfExpr =
478478
Result.Nodes.getNodeAs<UnaryExprOrTypeTraitExpr>("sizeof-ptr-div-expr");
479479

480-
if (Ctx.hasSameType(LPtrTy, RPtrTy) &&
481-
Ctx.hasSameType(LPtrTy, SizeofArgTy)) {
480+
if (ASTContext::hasSameType(LPtrTy, RPtrTy) &&
481+
ASTContext::hasSameType(LPtrTy, SizeofArgTy)) {
482482
diag(SizeOfExpr->getBeginLoc(), "suspicious usage of 'sizeof(...)' in "
483483
"pointer arithmetic")
484484
<< SizeOfExpr->getSourceRange() << E->getOperatorLoc()

0 commit comments

Comments
 (0)