Skip to content

Commit 746dd89

Browse files
author
Artem Gindinson
committed
Merge from 'main' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/lib/Sema/TreeTransform.h CONFLICT (content): Merge conflict in clang/lib/Sema/SemaStmtAttr.cpp
2 parents 534bc41 + 9711118 commit 746dd89

File tree

2,651 files changed

+165626
-53232
lines changed

Some content is hidden

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

2,651 files changed

+165626
-53232
lines changed

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ void BracesAroundStatementsCheck::storeOptions(
105105
}
106106

107107
void BracesAroundStatementsCheck::registerMatchers(MatchFinder *Finder) {
108-
Finder->addMatcher(
109-
ifStmt(unless(allOf(isConstexpr(), isInTemplateInstantiation())))
110-
.bind("if"),
111-
this);
108+
Finder->addMatcher(ifStmt().bind("if"), this);
112109
Finder->addMatcher(whileStmt().bind("while"), this);
113110
Finder->addMatcher(doStmt().bind("do"), this);
114111
Finder->addMatcher(forStmt().bind("for"), this);

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

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ class BracesAroundStatementsCheck : public ClangTidyCheck {
5555
template <typename IfOrWhileStmt>
5656
SourceLocation findRParenLoc(const IfOrWhileStmt *S, const SourceManager &SM,
5757
const ASTContext *Context);
58+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
59+
return TK_IgnoreUnlessSpelledInSource;
60+
}
5861

5962
private:
6063
std::set<const Stmt *> ForceBracesStmts;

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ void ElseAfterReturnCheck::registerPPCallbacks(const SourceManager &SM,
171171
void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
172172
const auto InterruptsControlFlow = stmt(anyOf(
173173
returnStmt().bind(InterruptingStr), continueStmt().bind(InterruptingStr),
174-
breakStmt().bind(InterruptingStr),
175-
expr(ignoringImplicit(cxxThrowExpr().bind(InterruptingStr)))));
174+
breakStmt().bind(InterruptingStr), cxxThrowExpr().bind(InterruptingStr)));
176175
Finder->addMatcher(
177176
compoundStmt(
178177
forEach(ifStmt(unless(isConstexpr()),

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

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class ElseAfterReturnCheck : public ClangTidyCheck {
2828
Preprocessor *ModuleExpanderPP) override;
2929
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3030
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
31+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
32+
return TK_IgnoreUnlessSpelledInSource;
33+
}
3134

3235
using ConditionalBranchMap =
3336
llvm::DenseMap<FileID, SmallVector<SourceRange, 1>>;

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ void InconsistentDeclarationParameterNameCheck::storeOptions(
294294

295295
void InconsistentDeclarationParameterNameCheck::registerMatchers(
296296
MatchFinder *Finder) {
297-
Finder->addMatcher(functionDecl(unless(isImplicit()), hasOtherDeclarations())
298-
.bind("functionDecl"),
297+
Finder->addMatcher(functionDecl(hasOtherDeclarations()).bind("functionDecl"),
299298
this);
300299
}
301300

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

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class InconsistentDeclarationParameterNameCheck : public ClangTidyCheck {
3333
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3434
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3535
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
36+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
37+
return TK_IgnoreUnlessSpelledInSource;
38+
}
3639

3740
private:
3841
void markRedeclarationsAsVisited(const FunctionDecl *FunctionDeclaration);

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ void MisleadingIndentationCheck::missingBracesCheck(const SourceManager &SM,
106106
}
107107

108108
void MisleadingIndentationCheck::registerMatchers(MatchFinder *Finder) {
109-
Finder->addMatcher(
110-
ifStmt(allOf(hasElse(stmt()),
111-
unless(allOf(isConstexpr(), isInTemplateInstantiation()))))
112-
.bind("if"),
113-
this);
109+
Finder->addMatcher(ifStmt(hasElse(stmt())).bind("if"), this);
114110
Finder->addMatcher(
115111
compoundStmt(has(stmt(anyOf(ifStmt(), forStmt(), whileStmt()))))
116112
.bind("compound"),

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

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class MisleadingIndentationCheck : public ClangTidyCheck {
2727
: ClangTidyCheck(Name, Context) {}
2828
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2929
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
30+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
31+
return TK_IgnoreUnlessSpelledInSource;
32+
}
3033

3134
private:
3235
void danglingElseCheck(const SourceManager &SM, ASTContext *Context,

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@ namespace tidy {
1818
namespace readability {
1919

2020
void NamedParameterCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
21-
Finder->addMatcher(functionDecl(unless(isInstantiated())).bind("decl"), this);
21+
Finder->addMatcher(functionDecl().bind("decl"), this);
2222
}
2323

2424
void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
2525
const SourceManager &SM = *Result.SourceManager;
2626
const auto *Function = Result.Nodes.getNodeAs<FunctionDecl>("decl");
2727
SmallVector<std::pair<const FunctionDecl *, unsigned>, 4> UnnamedParams;
2828

29-
// Ignore implicitly generated members.
30-
if (Function->isImplicit())
31-
return;
32-
3329
// Ignore declarations without a definition if we're not dealing with an
3430
// overriden method.
3531
const FunctionDecl *Definition = nullptr;

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

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class NamedParameterCheck : public ClangTidyCheck {
3232
: ClangTidyCheck(Name, Context) {}
3333
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3434
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
35+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
36+
return TK_IgnoreUnlessSpelledInSource;
37+
}
3538
};
3639

3740
} // namespace readability

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace readability {
1818

1919
void NonConstParameterCheck::registerMatchers(MatchFinder *Finder) {
2020
// Add parameters to Parameters.
21-
Finder->addMatcher(parmVarDecl(unless(isInstantiated())).bind("Parm"), this);
21+
Finder->addMatcher(parmVarDecl().bind("Parm"), this);
2222

2323
// C++ constructor.
2424
Finder->addMatcher(cxxConstructorDecl().bind("Ctor"), this);
@@ -28,13 +28,11 @@ void NonConstParameterCheck::registerMatchers(MatchFinder *Finder) {
2828
Finder->addMatcher(declRefExpr().bind("Ref"), this);
2929

3030
// Analyse parameter usage in function.
31-
Finder->addMatcher(
32-
traverse(TK_AsIs,
33-
stmt(anyOf(unaryOperator(hasAnyOperatorName("++", "--")),
34-
binaryOperator(), callExpr(), returnStmt(),
35-
cxxConstructExpr()))
36-
.bind("Mark")),
37-
this);
31+
Finder->addMatcher(stmt(anyOf(unaryOperator(hasAnyOperatorName("++", "--")),
32+
binaryOperator(), callExpr(), returnStmt(),
33+
cxxConstructExpr()))
34+
.bind("Mark"),
35+
this);
3836
Finder->addMatcher(varDecl(hasInitializer(anything())).bind("Mark"), this);
3937
}
4038

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

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class NonConstParameterCheck : public ClangTidyCheck {
2626
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2727
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2828
void onEndOfTranslationUnit() override;
29+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
30+
return TK_IgnoreUnlessSpelledInSource;
31+
}
2932

3033
private:
3134
/// Parameter info.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ bool isLocationInMacroExpansion(const SourceManager &SM, SourceLocation Loc) {
3232

3333
void RedundantControlFlowCheck::registerMatchers(MatchFinder *Finder) {
3434
Finder->addMatcher(
35-
functionDecl(
36-
isDefinition(), returns(voidType()),
37-
has(compoundStmt(hasAnySubstatement(returnStmt(unless(has(expr())))))
38-
.bind("return"))),
35+
functionDecl(isDefinition(), returns(voidType()),
36+
hasBody(compoundStmt(hasAnySubstatement(
37+
returnStmt(unless(has(expr())))))
38+
.bind("return"))),
3939
this);
4040
Finder->addMatcher(
4141
mapAnyOf(forStmt, cxxForRangeStmt, whileStmt, doStmt)

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

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class RedundantControlFlowCheck : public ClangTidyCheck {
2929
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3030
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3131

32+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
33+
return TK_IgnoreUnlessSpelledInSource;
34+
}
35+
3236
private:
3337
void
3438
checkRedundantReturn(const ast_matchers::MatchFinder::MatchResult &Result,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ void SimplifySubscriptExprCheck::registerMatchers(MatchFinder *Finder) {
3232
llvm::SmallVector<StringRef, 8>(Types.begin(), Types.end()))))));
3333

3434
Finder->addMatcher(
35-
arraySubscriptExpr(hasBase(ignoringParenImpCasts(
35+
arraySubscriptExpr(hasBase(
3636
cxxMemberCallExpr(
3737
has(memberExpr().bind("member")),
3838
on(hasType(qualType(
3939
unless(anyOf(substTemplateTypeParmType(),
4040
hasDescendant(substTemplateTypeParmType()))),
4141
anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)))))),
4242
callee(namedDecl(hasName("data"))))
43-
.bind("call")))),
43+
.bind("call"))),
4444
this);
4545
}
4646

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

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class SimplifySubscriptExprCheck : public ClangTidyCheck {
2828
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2929
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3030
void storeOptions(ClangTidyOptions::OptionMap& Opts) override;
31+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
32+
return TK_IgnoreUnlessSpelledInSource;
33+
}
3134

3235
private:
3336
const std::vector<std::string> Types;

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ void StaticAccessedThroughInstanceCheck::storeOptions(
3939
void StaticAccessedThroughInstanceCheck::registerMatchers(MatchFinder *Finder) {
4040
Finder->addMatcher(
4141
memberExpr(hasDeclaration(anyOf(cxxMethodDecl(isStaticStorageClass()),
42-
varDecl(hasStaticStorageDuration()))),
43-
unless(isInTemplateInstantiation()))
42+
varDecl(hasStaticStorageDuration()))))
4443
.bind("memberExpression"),
4544
this);
4645
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class StaticAccessedThroughInstanceCheck : public ClangTidyCheck {
3030
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3131
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3232
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
33+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
34+
return TK_IgnoreUnlessSpelledInSource;
35+
}
3336

3437
private:
3538
const unsigned NameSpecifierNestingThreshold;

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

+8-11
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,14 @@ void UniqueptrDeleteReleaseCheck::registerMatchers(MatchFinder *Finder) {
3939
Finder->addMatcher(
4040
cxxDeleteExpr(
4141
unless(isInTemplateInstantiation()),
42-
has(expr(ignoringParenImpCasts(
43-
cxxMemberCallExpr(
44-
callee(
45-
memberExpr(hasObjectExpression(allOf(
46-
unless(isTypeDependent()),
47-
anyOf(hasType(UniquePtrWithDefaultDelete),
48-
hasType(pointsTo(
49-
UniquePtrWithDefaultDelete))))),
50-
member(cxxMethodDecl(hasName("release"))))
51-
.bind("release_expr")))
52-
.bind("release_call")))))
42+
has(cxxMemberCallExpr(
43+
callee(memberExpr(hasObjectExpression(anyOf(
44+
hasType(UniquePtrWithDefaultDelete),
45+
hasType(pointsTo(
46+
UniquePtrWithDefaultDelete)))),
47+
member(cxxMethodDecl(hasName("release"))))
48+
.bind("release_expr")))
49+
.bind("release_call")))
5350
.bind("delete"),
5451
this);
5552
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class UniqueptrDeleteReleaseCheck : public ClangTidyCheck {
2626
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2727
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2828
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
29+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
30+
return TK_IgnoreUnlessSpelledInSource;
31+
}
2932

3033
private:
3134
const bool PreferResetCall;

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ void UppercaseLiteralSuffixCheck::registerMatchers(MatchFinder *Finder) {
196196
// Sadly, we can't check whether the literal has suffix or not.
197197
// E.g. i32 suffix still results in 'BuiltinType::Kind::Int'.
198198
// And such an info is not stored in the *Literal itself.
199-
Finder->addMatcher(traverse(TK_AsIs,
199+
Finder->addMatcher(
200200
stmt(eachOf(integerLiteral().bind(IntegerLiteralCheck::Name),
201201
floatLiteral().bind(FloatingLiteralCheck::Name)),
202202
unless(anyOf(hasParent(userDefinedLiteral()),
203-
hasAncestor(isImplicit()),
204-
hasAncestor(substNonTypeTemplateParmExpr()))))),
203+
hasAncestor(substNonTypeTemplateParmExpr())))),
205204
this);
206205
}
207206

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

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class UppercaseLiteralSuffixCheck : public ClangTidyCheck {
2828
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2929
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3030
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
31+
llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
32+
return TK_IgnoreUnlessSpelledInSource;
33+
}
3134

3235
private:
3336
template <typename LiteralType>

clang-tools-extra/clangd/index/Index.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ class SymbolIndex {
149149

150150
/// Returns function which checks if the specified file was used to build this
151151
/// index or not. The function must only be called while the index is alive.
152-
virtual llvm::unique_function<IndexContents(llvm::StringRef) const>
153-
indexedFiles() const = 0;
152+
using IndexedFiles =
153+
llvm::unique_function<IndexContents(llvm::StringRef) const>;
154+
virtual IndexedFiles indexedFiles() const = 0;
154155

155156
/// Returns estimated size of index (in bytes).
156157
virtual size_t estimateMemoryUsage() const = 0;

0 commit comments

Comments
 (0)