Skip to content

Commit d4c4e14

Browse files
committed
Merge remote-tracking branch 'llvm' into vinay-issue-100762
2 parents 3736854 + 10d84a8 commit d4c4e14

File tree

704 files changed

+28866
-10928
lines changed

Some content is hidden

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

704 files changed

+28866
-10928
lines changed

.ci/metrics/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"https://influx-prod-13-prod-us-east-0.grafana.net/api/v1/push/influx/write"
1313
)
1414
GITHUB_PROJECT = "llvm/llvm-project"
15-
WORKFLOWS_TO_TRACK = ["Check code formatting"]
15+
WORKFLOWS_TO_TRACK = ["Check code formatting", "LLVM Premerge Checks"]
1616
SCRAPE_INTERVAL_SECONDS = 5 * 60
1717

1818

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,6 @@ e80bc777749331e9519575f416c342f7626dd14d
9797

9898
# NFC: clang-format test_demangle.pass.cpp but keep test "lines"
9999
d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
100+
101+
# [lldb][NFC] clang-format MainLoopPosix.cpp
102+
66bdbfbaa08fa3d8e64a7fe136a8fb717f5cdbb7

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
/mlir/**/Transforms/SROA.* @moxinilian
130130

131131
# BOLT
132-
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
132+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci @yota9
133133

134134
# Bazel build system.
135135
/utils/bazel/ @rupprecht @keith

clang-tools-extra/clang-doc/Serialize.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ static RecordDecl *getRecordDeclForType(const QualType &T) {
236236
return nullptr;
237237
}
238238

239-
TypeInfo getTypeInfoForType(const QualType &T) {
239+
TypeInfo getTypeInfoForType(const QualType &T, const PrintingPolicy &Policy) {
240240
const TagDecl *TD = getTagDeclForType(T);
241241
if (!TD)
242-
return TypeInfo(Reference(SymbolID(), T.getAsString()));
242+
return TypeInfo(Reference(SymbolID(), T.getAsString(Policy)));
243243

244244
InfoType IT;
245245
if (dyn_cast<EnumDecl>(TD)) {
@@ -250,7 +250,7 @@ TypeInfo getTypeInfoForType(const QualType &T) {
250250
IT = InfoType::IT_default;
251251
}
252252
return TypeInfo(Reference(getUSRForDecl(TD), TD->getNameAsString(), IT,
253-
T.getAsString(), getInfoRelativePath(TD)));
253+
T.getAsString(Policy), getInfoRelativePath(TD)));
254254
}
255255

256256
static bool isPublic(const clang::AccessSpecifier AS,
@@ -379,10 +379,11 @@ static void parseFields(RecordInfo &I, const RecordDecl *D, bool PublicOnly,
379379
if (!shouldSerializeInfo(PublicOnly, /*IsInAnonymousNamespace=*/false, F))
380380
continue;
381381

382+
auto &LO = F->getLangOpts();
382383
// Use getAccessUnsafe so that we just get the default AS_none if it's not
383384
// valid, as opposed to an assert.
384385
MemberTypeInfo &NewMember = I.Members.emplace_back(
385-
getTypeInfoForType(F->getTypeSourceInfo()->getType()),
386+
getTypeInfoForType(F->getTypeSourceInfo()->getType(), LO),
386387
F->getNameAsString(),
387388
getFinalAccessSpecifier(Access, F->getAccessUnsafe()));
388389
populateMemberTypeInfo(NewMember, F);
@@ -412,9 +413,10 @@ static void parseEnumerators(EnumInfo &I, const EnumDecl *D) {
412413
}
413414

414415
static void parseParameters(FunctionInfo &I, const FunctionDecl *D) {
416+
auto &LO = D->getLangOpts();
415417
for (const ParmVarDecl *P : D->parameters()) {
416418
FieldTypeInfo &FieldInfo = I.Params.emplace_back(
417-
getTypeInfoForType(P->getOriginalType()), P->getNameAsString());
419+
getTypeInfoForType(P->getOriginalType(), LO), P->getNameAsString());
418420
FieldInfo.DefaultValue = getSourceCode(D, P->getDefaultArgRange());
419421
}
420422
}
@@ -541,7 +543,8 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
541543
bool &IsInAnonymousNamespace) {
542544
populateSymbolInfo(I, D, FC, LineNumber, Filename, IsFileInRootDir,
543545
IsInAnonymousNamespace);
544-
I.ReturnType = getTypeInfoForType(D->getReturnType());
546+
auto &LO = D->getLangOpts();
547+
I.ReturnType = getTypeInfoForType(D->getReturnType(), LO);
545548
parseParameters(I, D);
546549

547550
PopulateTemplateParameters(I.Template, D);
@@ -783,7 +786,8 @@ emitInfo(const TypedefDecl *D, const FullComment *FC, int LineNumber,
783786
return {};
784787

785788
Info.DefLoc.emplace(LineNumber, File, IsFileInRootDir);
786-
Info.Underlying = getTypeInfoForType(D->getUnderlyingType());
789+
auto &LO = D->getLangOpts();
790+
Info.Underlying = getTypeInfoForType(D->getUnderlyingType(), LO);
787791
if (Info.Underlying.Type.Name.empty()) {
788792
// Typedef for an unnamed type. This is like "typedef struct { } Foo;"
789793
// The record serializer explicitly checks for this syntax and constructs
@@ -809,7 +813,8 @@ emitInfo(const TypeAliasDecl *D, const FullComment *FC, int LineNumber,
809813
return {};
810814

811815
Info.DefLoc.emplace(LineNumber, File, IsFileInRootDir);
812-
Info.Underlying = getTypeInfoForType(D->getUnderlyingType());
816+
auto &LO = D->getLangOpts();
817+
Info.Underlying = getTypeInfoForType(D->getUnderlyingType(), LO);
813818
Info.IsUsing = true;
814819

815820
// Info is wrapped in its parent scope so is returned in the second position.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ struct MissingIncludeInfo {
5757
IncludeCleanerCheck::IncludeCleanerCheck(StringRef Name,
5858
ClangTidyContext *Context)
5959
: ClangTidyCheck(Name, Context),
60-
IgnoreHeaders(utils::options::parseStringList(
61-
Options.getLocalOrGlobal("IgnoreHeaders", ""))),
62-
DeduplicateFindings(
63-
Options.getLocalOrGlobal("DeduplicateFindings", true)) {
60+
IgnoreHeaders(
61+
utils::options::parseStringList(Options.get("IgnoreHeaders", ""))),
62+
DeduplicateFindings(Options.get("DeduplicateFindings", true)) {
6463
for (const auto &Header : IgnoreHeaders) {
6564
if (!llvm::Regex{Header}.isValid())
6665
configurationDiag("Invalid ignore headers regex '%0'") << Header;

clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class InconsistentDeclarationParameterNameCheck : public ClangTidyCheck {
2626
ClangTidyContext *Context)
2727
: ClangTidyCheck(Name, Context),
2828
IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)),
29-
Strict(Options.getLocalOrGlobal("Strict", false)) {}
29+
Strict(Options.get("Strict", false)) {}
3030

3131
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3232
void registerMatchers(ast_matchers::MatchFinder *Finder) override;

clang-tools-extra/clangd/unittests/DumpASTTests.cpp

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ declaration: Function - root
4949
)"},
5050
{R"cpp(
5151
namespace root {
52-
struct S { static const int x = 0; };
52+
struct S { static const int x = 0; ~S(); };
5353
int y = S::x + root::S().x;
5454
}
5555
)cpp",
@@ -60,10 +60,12 @@ declaration: Namespace - root
6060
type: Qualified - const
6161
type: Builtin - int
6262
expression: IntegerLiteral - 0
63+
declaration: CXXDestructor
64+
type: Record - S
65+
type: FunctionProto
66+
type: Builtin - void
6367
declaration: CXXConstructor
6468
declaration: CXXConstructor
65-
declaration: CXXConstructor
66-
declaration: CXXDestructor
6769
declaration: Var - y
6870
type: Builtin - int
6971
expression: ExprWithCleanups
@@ -74,14 +76,45 @@ declaration: Namespace - root
7476
type: Record - S
7577
expression: ImplicitCast - LValueToRValue
7678
expression: Member - x
77-
expression: MaterializeTemporary - rvalue
79+
expression: CXXBindTemporary
7880
expression: CXXTemporaryObject - S
7981
type: Elaborated
8082
specifier: Namespace - root::
8183
type: Record - S
8284
)"},
8385
{R"cpp(
8486
namespace root {
87+
struct S { static const int x = 0; };
88+
int y = S::x + root::S().x;
89+
}
90+
)cpp",
91+
R"(
92+
declaration: Namespace - root
93+
declaration: CXXRecord - S
94+
declaration: Var - x
95+
type: Qualified - const
96+
type: Builtin - int
97+
expression: IntegerLiteral - 0
98+
declaration: CXXConstructor
99+
declaration: CXXConstructor
100+
declaration: CXXConstructor
101+
declaration: CXXDestructor
102+
declaration: Var - y
103+
type: Builtin - int
104+
expression: BinaryOperator - +
105+
expression: ImplicitCast - LValueToRValue
106+
expression: DeclRef - x
107+
specifier: TypeSpec
108+
type: Record - S
109+
expression: ImplicitCast - LValueToRValue
110+
expression: Member - x
111+
expression: CXXTemporaryObject - S
112+
type: Elaborated
113+
specifier: Namespace - root::
114+
type: Record - S
115+
)"},
116+
{R"cpp(
117+
namespace root {
85118
template <typename T> int tmpl() {
86119
(void)tmpl<unsigned>();
87120
return T::value;

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ Improvements to clang-tidy
115115
- Improved :program:`run-clang-tidy.py` script. Fixed minor shutdown noise
116116
happening on certain platforms when interrupting the script.
117117

118+
- Removed :program:`clang-tidy`'s global options for most of checks. All options
119+
are changed to local options except `IncludeStyle`, `StrictMode` and
120+
`IgnoreMacros`.
121+
122+
.. csv-table::
123+
:header: "Check", "Options removed from global option"
124+
125+
:doc:`bugprone-reserved-identifier <clang-tidy/checks/bugprone/reserved-identifier>`, AggressiveDependentMemberLookup
126+
:doc:`bugprone-unchecked-optional-access <clang-tidy/checks/bugprone/unchecked-optional-access>`, IgnoreSmartPointerDereference
127+
:doc:`cppcoreguidelines-pro-type-member-init <clang-tidy/checks/cppcoreguidelines/pro-type-member-init>`, UseAssignment
128+
:doc:`cppcoreguidelines-rvalue-reference-param-not-moved <clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved>`, AllowPartialMove; IgnoreUnnamedParams; IgnoreNonDeducedTemplateTypes
129+
:doc:`misc-include-cleaner <clang-tidy/checks/misc/include-cleaner>`, IgnoreHeaders; DeduplicateFindings
130+
:doc:`performance-inefficient-vector-operation <clang-tidy/checks/performance/inefficient-vector-operation>`, EnableProto
131+
:doc:`readability-identifier-naming <clang-tidy/checks/readability/identifier-naming>`, AggressiveDependentMemberLookup
132+
:doc:`readability-inconsistent-declaration-parameter-name <clang-tidy/checks/readability/inconsistent-declaration-parameter-name>`, Strict
133+
:doc:`readability-redundant-access-specifiers <clang-tidy/checks/readability/redundant-access-specifiers>`, CheckFirstDeclaration
134+
:doc:`readability-redundant-casting <clang-tidy/checks/readability/redundant-casting>`, IgnoreTypeAliases
135+
118136
New checks
119137
^^^^^^^^^^
120138

clang-tools-extra/test/clang-doc/builtin_types.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ extern bool b();
2323
// YAML-NEXT: Filename: '{{.*}}'
2424
// YAML-NEXT: ReturnType:
2525
// YAML-NEXT: Type:
26-
// YAML-NEXT: Name: '_Bool'
27-
// YAML-NEXT: QualName: '_Bool'
26+
// YAML-NEXT: Name: 'bool'
27+
// YAML-NEXT: QualName: 'bool'
2828

2929
// MD: ### b
30-
// MD: *_Bool b()*
30+
// MD: *bool b()*
3131

3232
char c();
3333

clang-tools-extra/test/clang-doc/templates.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ void function<bool, 0>(bool x) {}
8080
// YAML-NEXT: Filename: '{{.*}}'
8181
// YAML-NEXT: Params:
8282
// YAML-NEXT: - Type:
83-
// YAML-NEXT: Name: '_Bool'
84-
// YAML-NEXT: QualName: '_Bool'
83+
// YAML-NEXT: Name: 'bool'
84+
// YAML-NEXT: QualName: 'bool'
8585
// YAML-NEXT: Name: 'x'
8686
// YAML-NEXT: ReturnType:
8787
// YAML-NEXT: Type:
@@ -95,7 +95,7 @@ void function<bool, 0>(bool x) {}
9595
// YAML-NEXT: - Contents: '0'
9696

9797
// MD: ### function
98-
// MD: *void function(_Bool x)*
98+
// MD: *void function(bool x)*
9999
// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 26]]*
100100

101101
/// A Tuple type
@@ -136,21 +136,21 @@ tuple<int,int,bool> func_with_tuple_param(tuple<int,int,bool> t){ return t;}
136136
// YAML-NEXT: - Type:
137137
// YAML-NEXT: Type: Record
138138
// YAML-NEXT: Name: 'tuple'
139-
// YAML-NEXT: QualName: 'tuple<int, int, _Bool>'
139+
// YAML-NEXT: QualName: 'tuple<int, int, bool>'
140140
// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
141141
// YAML-NEXT: Path: 'GlobalNamespace'
142142
// YAML-NEXT: Name: 't'
143143
// YAML-NEXT: ReturnType:
144144
// YAML-NEXT: Type:
145145
// YAML-NEXT: Type: Record
146146
// YAML-NEXT: Name: 'tuple'
147-
// YAML-NEXT: QualName: 'tuple<int, int, _Bool>'
147+
// YAML-NEXT: QualName: 'tuple<int, int, bool>'
148148
// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
149149
// YAML-NEXT: Path: 'GlobalNamespace'
150150
// YAML-NEXT: ...
151151

152152
// MD: ### func_with_tuple_param
153-
// MD: *tuple<int, int, _Bool> func_with_tuple_param(tuple<int, int, _Bool> t)*
153+
// MD: *tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t)*
154154
// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]*
155155
// MD: A function with a tuple parameter
156156
// MD: **t** The input to func_with_tuple_param

0 commit comments

Comments
 (0)