Skip to content

Commit dfd9ad3

Browse files
Merge branch 'llvm:main' into cfi-show
2 parents a6f6365 + 448811d commit dfd9ad3

File tree

184 files changed

+2976
-1391
lines changed

Some content is hidden

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

184 files changed

+2976
-1391
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BasedOnStyle: LLVM
2+
QualifierAlignment: Left

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

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

47-
for (CXXConstructorDecl const *C : Node.ctors()) {
47+
for (const CXXConstructorDecl *C : Node.ctors()) {
4848
if (C->isCopyOrMoveConstructor() && C->isDefaulted() && !C->isDeleted())
4949
return false;
5050
}
51-
for (CXXMethodDecl const *M : Node.methods()) {
51+
for (const CXXMethodDecl *M : Node.methods()) {
5252
if (M->isCopyAssignmentOperator())
5353
llvm::errs() << M->isDeleted() << "\n";
5454
if (M->isCopyAssignmentOperator() && M->isDefaulted() && !M->isDeleted())

clang-tools-extra/clang-tidy/bugprone/MultiLevelImplicitPointerConversionCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MultiLevelImplicitPointerConversionCheck : public ClangTidyCheck {
3131
}
3232

3333
private:
34-
bool const EnableInC;
34+
const bool EnableInC;
3535
};
3636

3737
} // namespace clang::tidy::bugprone

clang-tools-extra/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SmartPtrArrayMismatchCheck : public ClangTidyCheck {
4040
static const char PointerTypeN[];
4141

4242
private:
43-
StringRef const SmartPointerName;
43+
const StringRef SmartPointerName;
4444
};
4545

4646
} // namespace clang::tidy::bugprone

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ AST_MATCHER(VarDecl, isReferenced) { return Node.isReferenced(); }
3333
AST_MATCHER(VarDecl, explicitMarkUnused) {
3434
// Implementations should not emit a warning that a name-independent
3535
// declaration is used or unused.
36-
LangOptions const &LangOpts = Finder->getASTContext().getLangOpts();
36+
const LangOptions &LangOpts = Finder->getASTContext().getLangOpts();
3737
return Node.hasAttr<UnusedAttr>() ||
3838
(LangOpts.CPlusPlus26 && Node.isPlaceholderVar(LangOpts));
3939
}

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,73 @@ using namespace clang::ast_matchers;
1414

1515
namespace clang::tidy::cppcoreguidelines {
1616

17-
static bool isCopyConstructible(CXXRecordDecl const &Node) {
17+
static bool isCopyConstructible(const CXXRecordDecl &Node) {
1818
if (Node.needsOverloadResolutionForCopyConstructor() &&
1919
Node.needsImplicitCopyConstructor()) {
2020
// unresolved
21-
for (CXXBaseSpecifier const &BS : Node.bases()) {
22-
CXXRecordDecl const *BRD = BS.getType()->getAsCXXRecordDecl();
21+
for (const CXXBaseSpecifier &BS : Node.bases()) {
22+
const CXXRecordDecl *BRD = BS.getType()->getAsCXXRecordDecl();
2323
if (BRD != nullptr && !isCopyConstructible(*BRD))
2424
return false;
2525
}
2626
}
2727
if (Node.hasSimpleCopyConstructor())
2828
return true;
29-
for (CXXConstructorDecl const *Ctor : Node.ctors())
29+
for (const CXXConstructorDecl *Ctor : Node.ctors())
3030
if (Ctor->isCopyConstructor())
3131
return !Ctor->isDeleted();
3232
return false;
3333
}
3434

35-
static bool isMoveConstructible(CXXRecordDecl const &Node) {
35+
static bool isMoveConstructible(const CXXRecordDecl &Node) {
3636
if (Node.needsOverloadResolutionForMoveConstructor() &&
3737
Node.needsImplicitMoveConstructor()) {
3838
// unresolved
39-
for (CXXBaseSpecifier const &BS : Node.bases()) {
40-
CXXRecordDecl const *BRD = BS.getType()->getAsCXXRecordDecl();
39+
for (const CXXBaseSpecifier &BS : Node.bases()) {
40+
const CXXRecordDecl *BRD = BS.getType()->getAsCXXRecordDecl();
4141
if (BRD != nullptr && !isMoveConstructible(*BRD))
4242
return false;
4343
}
4444
}
4545
if (Node.hasSimpleMoveConstructor())
4646
return true;
47-
for (CXXConstructorDecl const *Ctor : Node.ctors())
47+
for (const CXXConstructorDecl *Ctor : Node.ctors())
4848
if (Ctor->isMoveConstructor())
4949
return !Ctor->isDeleted();
5050
return false;
5151
}
5252

53-
static bool isCopyAssignable(CXXRecordDecl const &Node) {
53+
static bool isCopyAssignable(const CXXRecordDecl &Node) {
5454
if (Node.needsOverloadResolutionForCopyAssignment() &&
5555
Node.needsImplicitCopyAssignment()) {
5656
// unresolved
57-
for (CXXBaseSpecifier const &BS : Node.bases()) {
58-
CXXRecordDecl const *BRD = BS.getType()->getAsCXXRecordDecl();
57+
for (const CXXBaseSpecifier &BS : Node.bases()) {
58+
const CXXRecordDecl *BRD = BS.getType()->getAsCXXRecordDecl();
5959
if (BRD != nullptr && !isCopyAssignable(*BRD))
6060
return false;
6161
}
6262
}
6363
if (Node.hasSimpleCopyAssignment())
6464
return true;
65-
for (CXXMethodDecl const *Method : Node.methods())
65+
for (const CXXMethodDecl *Method : Node.methods())
6666
if (Method->isCopyAssignmentOperator())
6767
return !Method->isDeleted();
6868
return false;
6969
}
7070

71-
static bool isMoveAssignable(CXXRecordDecl const &Node) {
71+
static bool isMoveAssignable(const CXXRecordDecl &Node) {
7272
if (Node.needsOverloadResolutionForMoveAssignment() &&
7373
Node.needsImplicitMoveAssignment()) {
7474
// unresolved
75-
for (CXXBaseSpecifier const &BS : Node.bases()) {
76-
CXXRecordDecl const *BRD = BS.getType()->getAsCXXRecordDecl();
75+
for (const CXXBaseSpecifier &BS : Node.bases()) {
76+
const CXXRecordDecl *BRD = BS.getType()->getAsCXXRecordDecl();
7777
if (BRD != nullptr && !isMoveAssignable(*BRD))
7878
return false;
7979
}
8080
}
8181
if (Node.hasSimpleMoveAssignment())
8282
return true;
83-
for (CXXMethodDecl const *Method : Node.methods())
83+
for (const CXXMethodDecl *Method : Node.methods())
8484
if (Method->isMoveAssignmentOperator())
8585
return !Method->isDeleted();
8686
return false;

clang-tools-extra/clang-tidy/misc/OverrideWithDifferentVisibilityCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using namespace clang;
1717
namespace {
1818

1919
AST_MATCHER(NamedDecl, isOperatorDecl) {
20-
DeclarationName::NameKind const NK = Node.getDeclName().getNameKind();
20+
const DeclarationName::NameKind NK = Node.getDeclName().getNameKind();
2121
return NK != DeclarationName::Identifier &&
2222
NK != DeclarationName::CXXConstructorName &&
2323
NK != DeclarationName::CXXDestructorName;
@@ -104,7 +104,7 @@ void OverrideWithDifferentVisibilityCheck::check(
104104

105105
const auto *const OverriddenFunction =
106106
Result.Nodes.getNodeAs<FunctionDecl>("base_func");
107-
AccessSpecifier const ActualAccess = MatchedFunction->getAccess();
107+
const AccessSpecifier ActualAccess = MatchedFunction->getAccess();
108108
AccessSpecifier OverriddenAccess = OverriddenFunction->getAccess();
109109

110110
const CXXBaseSpecifier *InheritanceWithStrictVisibility = nullptr;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ void ConcatNestedNamespacesCheck::reportDiagnostic(
152152
ConcatNameSpace.append("::");
153153
}
154154

155-
for (SourceRange const &Front : Fronts)
155+
for (const SourceRange &Front : Fronts)
156156
DB << FixItHint::CreateRemoval(Front);
157157
DB << FixItHint::CreateReplacement(
158158
Namespaces.back().getReplacedNamespaceFrontRange(), ConcatNameSpace);
159159
if (LastRBrace != Namespaces.back().getDefaultNamespaceBackRange())
160160
DB << FixItHint::CreateReplacement(LastRBrace,
161161
("} // " + ConcatNameSpace).str());
162-
for (SourceRange const &Back : llvm::reverse(Backs))
162+
for (const SourceRange &Back : llvm::reverse(Backs))
163163
DB << FixItHint::CreateRemoval(Back);
164164
}
165165

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D, ASTContext *Context) {
334334

335335
static void ignoreTypeLocClasses(
336336
TypeLoc &Loc,
337-
std::initializer_list<TypeLoc::TypeLocClass> const &LocClasses) {
337+
const std::initializer_list<TypeLoc::TypeLocClass> &LocClasses) {
338338
while (llvm::is_contained(LocClasses, Loc.getTypeLocClass()))
339339
Loc = Loc.getNextTypeLoc();
340340
}
341341

342342
static bool isMultiLevelPointerToTypeLocClasses(
343343
TypeLoc Loc,
344-
std::initializer_list<TypeLoc::TypeLocClass> const &LocClasses) {
344+
const std::initializer_list<TypeLoc::TypeLocClass> &LocClasses) {
345345
ignoreTypeLocClasses(Loc, {TypeLoc::Paren, TypeLoc::Qualified});
346346
TypeLoc::TypeLocClass TLC = Loc.getTypeLocClass();
347347
if (TLC != TypeLoc::Pointer && TLC != TypeLoc::MemberPointer)

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -953,30 +953,30 @@ std::string IdentifierNamingCheck::fixupWithCase(
953953
break;
954954

955955
case IdentifierNamingCheck::CT_LowerCase:
956-
for (auto const &Word : Words) {
956+
for (const auto &Word : Words) {
957957
if (&Word != &Words.front())
958958
Fixup += "_";
959959
Fixup += Word.lower();
960960
}
961961
break;
962962

963963
case IdentifierNamingCheck::CT_UpperCase:
964-
for (auto const &Word : Words) {
964+
for (const auto &Word : Words) {
965965
if (&Word != &Words.front())
966966
Fixup += "_";
967967
Fixup += Word.upper();
968968
}
969969
break;
970970

971971
case IdentifierNamingCheck::CT_CamelCase:
972-
for (auto const &Word : Words) {
972+
for (const auto &Word : Words) {
973973
Fixup += toupper(Word.front());
974974
Fixup += Word.substr(1).lower();
975975
}
976976
break;
977977

978978
case IdentifierNamingCheck::CT_CamelBack:
979-
for (auto const &Word : Words) {
979+
for (const auto &Word : Words) {
980980
if (&Word == &Words.front()) {
981981
Fixup += Word.lower();
982982
} else {
@@ -987,7 +987,7 @@ std::string IdentifierNamingCheck::fixupWithCase(
987987
break;
988988

989989
case IdentifierNamingCheck::CT_CamelSnakeCase:
990-
for (auto const &Word : Words) {
990+
for (const auto &Word : Words) {
991991
if (&Word != &Words.front())
992992
Fixup += "_";
993993
Fixup += toupper(Word.front());
@@ -996,7 +996,7 @@ std::string IdentifierNamingCheck::fixupWithCase(
996996
break;
997997

998998
case IdentifierNamingCheck::CT_CamelSnakeBack:
999-
for (auto const &Word : Words) {
999+
for (const auto &Word : Words) {
10001000
if (&Word != &Words.front()) {
10011001
Fixup += "_";
10021002
Fixup += toupper(Word.front());
@@ -1008,7 +1008,7 @@ std::string IdentifierNamingCheck::fixupWithCase(
10081008
break;
10091009

10101010
case IdentifierNamingCheck::CT_LeadingUpperSnakeCase:
1011-
for (auto const &Word : Words) {
1011+
for (const auto &Word : Words) {
10121012
if (&Word != &Words.front()) {
10131013
Fixup += "_";
10141014
Fixup += Word.lower();

0 commit comments

Comments
 (0)