Skip to content

Commit fb456e0

Browse files
committed
rebase
Created using spr 1.3.5-bogner
2 parents f468062 + 0885740 commit fb456e0

File tree

1,277 files changed

+58182
-18759
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,277 files changed

+58182
-18759
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@ jobs:
2121
- os: ubuntu-24.04
2222
build_type: Debug
2323
ccache-variant: sccache
24-
c_compiler: clang-20
25-
cpp_compiler: clang++-20
24+
c_compiler: clang-22
25+
cpp_compiler: clang++-22
2626
target: x86_64-unknown-linux-llvm
2727
include_scudo: ON
2828
- os: ubuntu-24.04
2929
build_type: Release
3030
ccache-variant: sccache
31-
c_compiler: clang-20
32-
cpp_compiler: clang++-20
31+
c_compiler: clang-22
32+
cpp_compiler: clang++-22
3333
target: x86_64-unknown-linux-llvm
3434
include_scudo: ON
3535
- os: ubuntu-24.04
3636
build_type: MinSizeRel
3737
ccache-variant: sccache
38-
c_compiler: clang-20
39-
cpp_compiler: clang++-20
38+
c_compiler: clang-22
39+
cpp_compiler: clang++-22
4040
target: x86_64-unknown-linux-llvm
4141
include_scudo: ON
4242
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
4343
- os: ubuntu-24.04-arm
4444
build_type: Debug
4545
ccache-variant: ccache
46-
c_compiler: clang-20
47-
cpp_compiler: clang++-20
46+
c_compiler: clang-22
47+
cpp_compiler: clang++-22
4848
target: aarch64-unknown-linux-llvm
4949
include_scudo: ON
5050
- os: ubuntu-24.04
5151
build_type: Debug
5252
ccache-variant: ccache
53-
c_compiler: clang-20
54-
cpp_compiler: clang++-20
53+
c_compiler: clang-22
54+
cpp_compiler: clang++-22
5555
target: x86_64-unknown-uefi-llvm
5656
include_scudo: OFF
5757
# TODO: add back gcc build when it is fixed
@@ -81,7 +81,7 @@ jobs:
8181
run: |
8282
wget https://apt.llvm.org/llvm.sh
8383
chmod +x llvm.sh
84-
sudo ./llvm.sh 20
84+
sudo ./llvm.sh 22
8585
sudo apt-get update
8686
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
8787
sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm

bolt/lib/Core/Exceptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ bool CFIReaderWriter::fillCFIInfoFor(BinaryFunction &Function) const {
500500

501501
const FDE &CurFDE = *I->second;
502502
std::optional<uint64_t> LSDA = CurFDE.getLSDAAddress();
503-
Function.setLSDAAddress(LSDA ? *LSDA : 0);
503+
Function.setLSDAAddress(LSDA.value_or(0));
504504

505505
uint64_t Offset = Function.getFirstInstructionOffset();
506506
uint64_t CodeAlignment = CurFDE.getLinkedCIE()->getCodeAlignmentFactor();

clang-tools-extra/clang-include-fixer/IncludeFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Action : public clang::ASTFrontendAction {
5353

5454
Compiler->createSema(getTranslationUnitKind(), CompletionConsumer);
5555
SemaSource->setCompilerInstance(Compiler);
56-
Compiler->getSema().addExternalSource(SemaSource.get());
56+
Compiler->getSema().addExternalSource(SemaSource);
5757

5858
clang::ParseAST(Compiler->getSema(), Compiler->getFrontendOpts().ShowStats,
5959
Compiler->getFrontendOpts().SkipFunctionBodies);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ Checks: >
1616
-modernize-use-trailing-return-type,
1717
performance-*,
1818
-performance-enum-size,
19-
-performance-move-const-arg,
2019
-performance-no-int-to-ptr,
2120
-performance-type-promotion-in-math-fn,
2221
-performance-unnecessary-value-param,
2322
readability-*,
2423
-readability-avoid-nested-conditional-operator,
25-
-readability-avoid-return-with-void-value,
2624
-readability-braces-around-statements,
2725
-readability-container-contains,
2826
-readability-convert-member-functions-to-static,
@@ -39,3 +37,7 @@ Checks: >
3937
-readability-static-definition-in-anonymous-namespace,
4038
-readability-suspicious-call-argument,
4139
-readability-use-anyofallof
40+
41+
CheckOptions:
42+
- key: performance-move-const-arg.CheckTriviallyCopyableMove
43+
value: false

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ bool isCompleteAndHasNoZeroValue(const EnumDecl *D) {
2222
const EnumDecl *Definition = D->getDefinition();
2323
return Definition && Definition->isComplete() &&
2424
!Definition->enumerators().empty() &&
25-
std::none_of(Definition->enumerator_begin(),
26-
Definition->enumerator_end(),
27-
[](const EnumConstantDecl *Value) {
28-
return Value->getInitVal().isZero();
29-
});
25+
llvm::none_of(Definition->enumerators(),
26+
[](const EnumConstantDecl *Value) {
27+
return Value->getInitVal().isZero();
28+
});
3029
}
3130

3231
AST_MATCHER(EnumDecl, isCompleteAndHasNoZeroValue) {

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

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,11 @@ void NarrowingConversionsCheck::diagNarrowTypeOrConstant(
381381
const Expr &Rhs) {
382382
APValue Constant = getConstantExprValue(Context, Rhs);
383383
if (Constant.isInt())
384-
return diagNarrowIntegerConstant(SourceLoc, Lhs, Rhs, Constant.getInt());
385-
if (Constant.isFloat())
386-
return diagNarrowConstant(SourceLoc, Lhs, Rhs);
387-
return diagNarrowType(SourceLoc, Lhs, Rhs);
384+
diagNarrowIntegerConstant(SourceLoc, Lhs, Rhs, Constant.getInt());
385+
else if (Constant.isFloat())
386+
diagNarrowConstant(SourceLoc, Lhs, Rhs);
387+
else
388+
diagNarrowType(SourceLoc, Lhs, Rhs);
388389
}
389390

390391
void NarrowingConversionsCheck::handleIntegralCast(const ASTContext &Context,
@@ -460,10 +461,10 @@ void NarrowingConversionsCheck::handleFloatingToIntegral(
460461
llvm::APFloat FloatConstant(0.0);
461462
if (getFloatingConstantExprValue(Context, Rhs, FloatConstant)) {
462463
if (!isFloatExactlyRepresentable(Context, FloatConstant, Lhs.getType()))
463-
return diagNarrowConstant(SourceLoc, Lhs, Rhs);
464+
diagNarrowConstant(SourceLoc, Lhs, Rhs);
464465

465-
if (PedanticMode)
466-
return diagConstantCast(SourceLoc, Lhs, Rhs);
466+
else if (PedanticMode)
467+
diagConstantCast(SourceLoc, Lhs, Rhs);
467468

468469
return;
469470
}
@@ -478,7 +479,7 @@ void NarrowingConversionsCheck::handleFloatingToIntegral(
478479
void NarrowingConversionsCheck::handleFloatingToBoolean(
479480
const ASTContext &Context, SourceLocation SourceLoc, const Expr &Lhs,
480481
const Expr &Rhs) {
481-
return diagNarrowTypeOrConstant(Context, SourceLoc, Lhs, Rhs);
482+
diagNarrowTypeOrConstant(Context, SourceLoc, Lhs, Rhs);
482483
}
483484

484485
void NarrowingConversionsCheck::handleBooleanToSignedIntegral(
@@ -532,19 +533,20 @@ void NarrowingConversionsCheck::handleBinaryOperator(const ASTContext &Context,
532533
if (LhsType == RhsType)
533534
return;
534535
if (RhsType->getKind() == BuiltinType::Bool && LhsType->isSignedInteger())
535-
return handleBooleanToSignedIntegral(Context, SourceLoc, Lhs, Rhs);
536-
if (RhsType->isInteger() && LhsType->getKind() == BuiltinType::Bool)
537-
return handleIntegralToBoolean(Context, SourceLoc, Lhs, Rhs);
538-
if (RhsType->isInteger() && LhsType->isFloatingPoint())
539-
return handleIntegralToFloating(Context, SourceLoc, Lhs, Rhs);
540-
if (RhsType->isInteger() && LhsType->isInteger())
541-
return handleIntegralCast(Context, SourceLoc, Lhs, Rhs);
542-
if (RhsType->isFloatingPoint() && LhsType->getKind() == BuiltinType::Bool)
543-
return handleFloatingToBoolean(Context, SourceLoc, Lhs, Rhs);
544-
if (RhsType->isFloatingPoint() && LhsType->isInteger())
545-
return handleFloatingToIntegral(Context, SourceLoc, Lhs, Rhs);
546-
if (RhsType->isFloatingPoint() && LhsType->isFloatingPoint())
547-
return handleFloatingCast(Context, SourceLoc, Lhs, Rhs);
536+
handleBooleanToSignedIntegral(Context, SourceLoc, Lhs, Rhs);
537+
else if (RhsType->isInteger() && LhsType->getKind() == BuiltinType::Bool)
538+
handleIntegralToBoolean(Context, SourceLoc, Lhs, Rhs);
539+
else if (RhsType->isInteger() && LhsType->isFloatingPoint())
540+
handleIntegralToFloating(Context, SourceLoc, Lhs, Rhs);
541+
else if (RhsType->isInteger() && LhsType->isInteger())
542+
handleIntegralCast(Context, SourceLoc, Lhs, Rhs);
543+
else if (RhsType->isFloatingPoint() &&
544+
LhsType->getKind() == BuiltinType::Bool)
545+
handleFloatingToBoolean(Context, SourceLoc, Lhs, Rhs);
546+
else if (RhsType->isFloatingPoint() && LhsType->isInteger())
547+
handleFloatingToIntegral(Context, SourceLoc, Lhs, Rhs);
548+
else if (RhsType->isFloatingPoint() && LhsType->isFloatingPoint())
549+
handleFloatingCast(Context, SourceLoc, Lhs, Rhs);
548550
}
549551

550552
bool NarrowingConversionsCheck::handleConditionalOperator(
@@ -577,21 +579,28 @@ void NarrowingConversionsCheck::handleImplicitCast(
577579
SourceLocation SourceLoc = Lhs.getExprLoc();
578580
switch (Cast.getCastKind()) {
579581
case CK_BooleanToSignedIntegral:
580-
return handleBooleanToSignedIntegral(Context, SourceLoc, Lhs, Rhs);
582+
handleBooleanToSignedIntegral(Context, SourceLoc, Lhs, Rhs);
583+
return;
581584
case CK_IntegralToBoolean:
582-
return handleIntegralToBoolean(Context, SourceLoc, Lhs, Rhs);
585+
handleIntegralToBoolean(Context, SourceLoc, Lhs, Rhs);
586+
return;
583587
case CK_IntegralToFloating:
584-
return handleIntegralToFloating(Context, SourceLoc, Lhs, Rhs);
588+
handleIntegralToFloating(Context, SourceLoc, Lhs, Rhs);
589+
return;
585590
case CK_IntegralCast:
586-
return handleIntegralCast(Context, SourceLoc, Lhs, Rhs);
591+
handleIntegralCast(Context, SourceLoc, Lhs, Rhs);
592+
return;
587593
case CK_FloatingToBoolean:
588-
return handleFloatingToBoolean(Context, SourceLoc, Lhs, Rhs);
594+
handleFloatingToBoolean(Context, SourceLoc, Lhs, Rhs);
595+
return;
589596
case CK_FloatingToIntegral:
590-
return handleFloatingToIntegral(Context, SourceLoc, Lhs, Rhs);
597+
handleFloatingToIntegral(Context, SourceLoc, Lhs, Rhs);
598+
return;
591599
case CK_FloatingCast:
592-
return handleFloatingCast(Context, SourceLoc, Lhs, Rhs);
600+
handleFloatingCast(Context, SourceLoc, Lhs, Rhs);
601+
return;
593602
default:
594-
break;
603+
return;
595604
}
596605
}
597606

@@ -610,9 +619,10 @@ void NarrowingConversionsCheck::handleBinaryOperator(const ASTContext &Context,
610619

611620
void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) {
612621
if (const auto *Op = Result.Nodes.getNodeAs<BinaryOperator>("binary_op"))
613-
return handleBinaryOperator(*Result.Context, *Op);
614-
if (const auto *Cast = Result.Nodes.getNodeAs<ImplicitCastExpr>("cast"))
615-
return handleImplicitCast(*Result.Context, *Cast);
616-
llvm_unreachable("must be binary operator or cast expression");
622+
handleBinaryOperator(*Result.Context, *Op);
623+
else if (const auto *Cast = Result.Nodes.getNodeAs<ImplicitCastExpr>("cast"))
624+
handleImplicitCast(*Result.Context, *Cast);
625+
else
626+
llvm_unreachable("must be binary operator or cast expression");
617627
}
618628
} // namespace clang::tidy::bugprone

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ namespace {
2222
AST_MATCHER(EnumDecl, isCompleteAndHasNoZeroValue) {
2323
const EnumDecl *Definition = Node.getDefinition();
2424
return Definition && Node.isComplete() &&
25-
std::none_of(Definition->enumerator_begin(),
26-
Definition->enumerator_end(),
27-
[](const EnumConstantDecl *Value) {
28-
return Value->getInitVal().isZero();
29-
});
25+
llvm::none_of(Definition->enumerators(),
26+
[](const EnumConstantDecl *Value) {
27+
return Value->getInitVal().isZero();
28+
});
3029
}
3130

3231
} // namespace

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,15 @@ void TaggedUnionMemberCountCheck::storeOptions(
105105

106106
void TaggedUnionMemberCountCheck::registerMatchers(MatchFinder *Finder) {
107107

108-
auto UnionField = fieldDecl(hasType(qualType(
109-
hasCanonicalType(recordType(hasDeclaration(recordDecl(isUnion())))))));
108+
auto NotFromSystemHeaderOrStdNamespace =
109+
unless(anyOf(isExpansionInSystemHeader(), isInStdNamespace()));
110110

111-
auto EnumField = fieldDecl(hasType(
112-
qualType(hasCanonicalType(enumType(hasDeclaration(enumDecl()))))));
111+
auto UnionField =
112+
fieldDecl(hasType(qualType(hasCanonicalType(recordType(hasDeclaration(
113+
recordDecl(isUnion(), NotFromSystemHeaderOrStdNamespace)))))));
114+
115+
auto EnumField = fieldDecl(hasType(qualType(hasCanonicalType(
116+
enumType(hasDeclaration(enumDecl(NotFromSystemHeaderOrStdNamespace)))))));
113117

114118
auto HasOneUnionField = fieldCountOfKindIsOne(UnionField, UnionMatchBindName);
115119
auto HasOneEnumField = fieldCountOfKindIsOne(EnumField, TagMatchBindName);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) {
132132
hasAncestor(functionDecl().bind("func")),
133133
hasAncestor(functionDecl(
134134
isDefinition(), equalsBoundNode("func"), ToParam,
135-
unless(anyOf(isDeleted(),
136-
hasDescendant(std::move(ForwardCallMatcher))))))),
135+
unless(anyOf(isDeleted(), hasDescendant(ForwardCallMatcher)))))),
137136
this);
138137
}
139138

clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) {
6767
hasParent(fieldDecl(
6868
hasParent(recordDecl(isExternCContext())))),
6969
hasAncestor(functionDecl(isExternC())))),
70-
std::move(IgnoreStringArrayIfNeededMatcher))
70+
IgnoreStringArrayIfNeededMatcher)
7171
.bind("typeloc"),
7272
this);
7373
}

0 commit comments

Comments
 (0)