Skip to content

Commit

Permalink
Overwritten with: 05ca407 Merged master:c295a65da49 into amd-gfx:6748…
Browse files Browse the repository at this point in the history
…894db1e

Based on upstream llvm : c295a65 [mlir] [VectorOps] Add 'vector.flat_transpose' operation

Local changes since 3a1103f:
05ca407 Merged master:c295a65da49 into amd-gfx:6748894db1e
6748894 Merged master:31f40f603d0 into amd-gfx:80e19880323
80e1988 Revert "[AMDGPU] Disable endcf collapse again"
f6f8dba Merged master:6bbaa62d26b into amd-gfx:c2f8b73ef35
c2f8b73 Merged master:8e3307f5519 into amd-gfx:ffdc239d29e
ffdc239 Merged master:9a0b0855a96 into amd-gfx:652b20556cf
652b205 Merged master:9eacda51fa2 into amd-gfx:06c312c8862
06c312c Merged master:d1f0a76b219 into amd-gfx:b609c6bc6d4
b609c6b Merged master:8bc03d21682 into amd-gfx:960c5e1190d
960c5e1 Merged master:792575ff323 into amd-gfx:e5da9f90ea0
e5da9f9 Merged master:c5bbc8dd6d6 into amd-gfx:5187bdabc9e
5187bda Revert local changes to LiveRangeCalc and RegisterCoalescer
099d9b5 Merged master:80cc43b420a into amd-gfx:1bf369d0317
1bf369d Merged master:34e39eb2adc into amd-gfx:44cde4286be
44cde42 Merged master:9d55e4ee136 into amd-gfx:e145900d8f8
e145900 Merged master:9a8d7bd7704 into amd-gfx:d30d5903bc7
d30d590 Merged master:3a2df3bad07 into amd-gfx:418304c43ae
418304c Merged master:179c80117c9 into amd-gfx:ea6f2908759
ea6f290 Merged master:51a276c759c into amd-gfx:a442e1e9af7
a442e1e Merged master:5bf2409a4e4 into amd-gfx:f02e6eca3c9
f02e6ec Merged master:7c298c104bf into amd-gfx:e379e37ab69
e379e37 Merged master:5d6c5b463ca into amd-gfx:d32f34d54b9
d32f34d Merged master:9ff361b099f into amd-gfx:ab819ab2285
ab819ab Merged master:83bd2c4a068 into amd-gfx:71137c55831
71137c5 Merged master:5b7ff6f07ff into amd-gfx:1d7df14175b
1d7df14 Merged master:1b79509f97b into amd-gfx:70a6b363e2e
70a6b36 Merged master:52b03aaa22f into amd-gfx:6e018a3ff5a
6e018a3 Merged master:d0da5d2bbe8 into amd-gfx:ecb862b706c
ecb862b Merged master:2be92b7f7e4 into amd-gfx:d4d66176d0b
d4d6617 Merged master:8a5aea7b504 into amd-gfx:71e7cbc5398
71e7cbc Merged master:d43fac052e1 into amd-gfx:ce3589e69ce
ce3589e Merged master:4c5818dd8cd into amd-gfx:6e1d643447e
6e1d643 Merged master:3ed8ebc2f6b into amd-gfx:8da38b55bb2
8da38b5 Merged master:f794808bb9e into amd-gfx:05320d7a26f
05320d7 Merged master:2bb822bc902 into amd-gfx:283cdda3e48
283cdda Merged master:088fb973484 into amd-gfx:c4aada5f72c
c4aada5 Merged master:9292ece9956 into amd-gfx:60c505a7221
60c505a Merged master:b631f86ac5b into amd-gfx:f8f92f28e4b
f8f92f2 Merged master:2e43bab1c16 into amd-gfx:6b278f1396b
6b278f1 Merged master:27fe841aa65 into amd-gfx:5b87fc6d838
5b87fc6 Merged master:304b0ed4039 into amd-gfx:d6da82a01ea
d6da82a Merged master:174322c2737 into amd-gfx:1fc9c9226d7
1fc9c92 Merged master:0c6bba71e39 into amd-gfx:b977c4043a3
b977c40 Merged master:0f6bd9cda6c into amd-gfx:9471c21a32e
9471c21 Merged master:64356b6d94e into amd-gfx:da21a0b39de
da21a0b Merged master:a8a048ac725 into amd-gfx:1f4f0bca85c
1f4f0bc Merged master:0231227e5d8 into amd-gfx:5c3fdab71ab
5c3fdab Merged master:a28e9f12086 into amd-gfx:792ac253c69
792ac25 Merged master:e4bb3e25e44 into amd-gfx:3974042f37e
3974042 Merged master:5451289abaf into amd-gfx:f0cd56a3ab6
f0cd56a Merged master:8a6333ef380 into amd-gfx:308fc24ba51
308fc24 Merged master:c7e5454acec into amd-gfx:dbabb2bf465
dbabb2b Merged master:329abed10b8 into amd-gfx:92039d2cd59
92039d2 Merged master:49a4f3f7d88 into amd-gfx:9c1698c4caf
9c1698c Merged master:bb7fb6d7b2f into amd-gfx:9d914d750a0
9d914d7 Merged master:628f008b201 into amd-gfx:536937b3dc3

Added AMD modification notices and removed some GPL files.

Change-Id: I2c76a37a09c4a866ff0bb1b346af9fed9426d707
  • Loading branch information
Tim Renouf committed May 28, 2020
2 parents 3a1103f + 05ca407 commit 7b9d0cf
Show file tree
Hide file tree
Showing 1,442 changed files with 46,926 additions and 27,527 deletions.
14 changes: 0 additions & 14 deletions clang-tools-extra/clang-doc/Generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ findGeneratorByName(llvm::StringRef Format) {

// Enum conversion

std::string getAccess(AccessSpecifier AS) {
switch (AS) {
case AccessSpecifier::AS_public:
return "public";
case AccessSpecifier::AS_protected:
return "protected";
case AccessSpecifier::AS_private:
return "private";
case AccessSpecifier::AS_none:
return {};
}
llvm_unreachable("Unknown AccessSpecifier");
}

std::string getTagType(TagTypeKind AS) {
switch (AS) {
case TagTypeKind::TTK_Class:
Expand Down
2 changes: 0 additions & 2 deletions clang-tools-extra/clang-doc/Generators.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ typedef llvm::Registry<Generator> GeneratorRegistry;
llvm::Expected<std::unique_ptr<Generator>>
findGeneratorByName(llvm::StringRef Format);

std::string getAccess(AccessSpecifier AS);

std::string getTagType(TagTypeKind AS);

} // namespace doc
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-doc/HTMLGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ genRecordMembersBlock(const llvm::SmallVector<MemberTypeInfo, 4> &Members,
Out.emplace_back(std::make_unique<TagNode>(HTMLTag::TAG_UL));
auto &ULBody = Out.back();
for (const auto &M : Members) {
std::string Access = getAccess(M.Access);
std::string Access = getAccessSpelling(M.Access).str();
if (Access != "")
Access = Access + " ";
auto LIBody = std::make_unique<TagNode>(HTMLTag::TAG_LI);
Expand Down Expand Up @@ -679,7 +679,7 @@ genHTML(const FunctionInfo &I, const ClangDocContext &CDCtx,
Out.emplace_back(std::make_unique<TagNode>(HTMLTag::TAG_P));
auto &FunctionHeader = Out.back();

std::string Access = getAccess(I.Access);
std::string Access = getAccessSpelling(I.Access).str();
if (Access != "")
FunctionHeader->Children.emplace_back(
std::make_unique<TextNode>(Access + " "));
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-doc/MDGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void genMarkdown(const ClangDocContext &CDCtx, const FunctionInfo &I,
First = false;
}
writeHeader(I.Name, 3, OS);
std::string Access = getAccess(I.Access);
std::string Access = getAccessSpelling(I.Access).str();
if (Access != "")
writeLine(genItalic(Access + " " + I.ReturnType.Type.Name + " " + I.Name +
"(" + Stream.str() + ")"),
Expand Down Expand Up @@ -250,7 +250,7 @@ static void genMarkdown(const ClangDocContext &CDCtx, const RecordInfo &I,
if (!I.Members.empty()) {
writeHeader("Members", 2, OS);
for (const auto &Member : I.Members) {
std::string Access = getAccess(Member.Access);
std::string Access = getAccessSpelling(Member.Access).str();
if (Access != "")
writeLine(Access + " " + Member.Type.Name + " " + Member.Name, OS);
else
Expand Down
12 changes: 12 additions & 0 deletions clang-tools-extra/clang-query/Query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ bool HelpQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
"Set whether to bind the root matcher to \"root\".\n"
" set print-matcher (true|false) "
"Set whether to print the current matcher,\n"
" set traversal <kind> "
"Set traversal kind of clang-query session. Available kinds are:\n"
" AsIs "
"Print and match the AST as clang sees it.\n"
" IgnoreImplicitCastsAndParentheses "
"Omit implicit casts and parens in matching and dumping.\n"
" IgnoreUnlessSpelledInSource "
"Omit AST nodes unless spelled in the source. This mode is the "
"default.\n"
" set output <feature> "
"Set whether to output only <feature> content.\n"
" enable output <feature> "
Expand Down Expand Up @@ -98,6 +107,8 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
OS << "Not a valid top-level matcher.\n";
return false;
}

AST->getASTContext().getParentMapContext().setTraversalKind(QS.TK);
Finder.matchAST(AST->getASTContext());

if (QS.PrintMatcher) {
Expand Down Expand Up @@ -148,6 +159,7 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
const SourceManager &SM = Ctx.getSourceManager();
ASTDumper Dumper(OS, &Ctx.getCommentCommandTraits(), &SM,
SM.getDiagnostics().getShowColors(), Ctx.getPrintingPolicy());
Dumper.SetTraversalKind(QS.TK);
Dumper.Visit(BI->second);
OS << "\n";
}
Expand Down
5 changes: 5 additions & 0 deletions clang-tools-extra/clang-query/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum QueryKind {
QK_Match,
QK_SetBool,
QK_SetOutputKind,
QK_SetTraversalKind,
QK_EnableOutputKind,
QK_DisableOutputKind,
QK_Quit
Expand Down Expand Up @@ -119,6 +120,10 @@ template <> struct SetQueryKind<OutputKind> {
static const QueryKind value = QK_SetOutputKind;
};

template <> struct SetQueryKind<ast_type_traits::TraversalKind> {
static const QueryKind value = QK_SetTraversalKind;
};

/// Query for "set VAR VALUE".
template <typename T> struct SetQuery : Query {
SetQuery(T QuerySession::*Var, T Value)
Expand Down
25 changes: 24 additions & 1 deletion clang-tools-extra/clang-query/QueryParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ template <typename QueryType> QueryRef QueryParser::parseSetOutputKind() {
llvm_unreachable("Invalid output kind");
}

QueryRef QueryParser::parseSetTraversalKind(
ast_type_traits::TraversalKind QuerySession::*Var) {
StringRef ValStr;
unsigned Value =
LexOrCompleteWord<unsigned>(this, ValStr)
.Case("AsIs", ast_type_traits::TK_AsIs)
.Case("IgnoreImplicitCastsAndParentheses",
ast_type_traits::TK_IgnoreImplicitCastsAndParentheses)
.Case("IgnoreUnlessSpelledInSource",
ast_type_traits::TK_IgnoreUnlessSpelledInSource)
.Default(~0u);
if (Value == ~0u) {
return new InvalidQuery("expected traversal kind, got '" + ValStr + "'");
}
return new SetQuery<ast_type_traits::TraversalKind>(
Var, static_cast<ast_type_traits::TraversalKind>(Value));
}

QueryRef QueryParser::endQuery(QueryRef Q) {
StringRef Extra = Line;
StringRef ExtraTrimmed = Extra.drop_while(
Expand Down Expand Up @@ -171,7 +189,8 @@ enum ParsedQueryVariable {
PQV_Invalid,
PQV_Output,
PQV_BindRoot,
PQV_PrintMatcher
PQV_PrintMatcher,
PQV_Traversal
};

QueryRef makeInvalidQueryFromDiagnostics(const Diagnostics &Diag) {
Expand Down Expand Up @@ -272,6 +291,7 @@ QueryRef QueryParser::doParse() {
.Case("output", PQV_Output)
.Case("bind-root", PQV_BindRoot)
.Case("print-matcher", PQV_PrintMatcher)
.Case("traversal", PQV_Traversal)
.Default(PQV_Invalid);
if (VarStr.empty())
return new InvalidQuery("expected variable name");
Expand All @@ -289,6 +309,9 @@ QueryRef QueryParser::doParse() {
case PQV_PrintMatcher:
Q = parseSetBool(&QuerySession::PrintMatcher);
break;
case PQV_Traversal:
Q = parseSetTraversalKind(&QuerySession::TK);
break;
case PQV_Invalid:
llvm_unreachable("Invalid query kind");
}
Expand Down
2 changes: 2 additions & 0 deletions clang-tools-extra/clang-query/QueryParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class QueryParser {
template <typename T> struct LexOrCompleteWord;

QueryRef parseSetBool(bool QuerySession::*Var);
QueryRef
parseSetTraversalKind(ast_type_traits::TraversalKind QuerySession::*Var);
template <typename QueryType> QueryRef parseSetOutputKind();
QueryRef completeMatcherExpression();

Expand Down
5 changes: 4 additions & 1 deletion clang-tools-extra/clang-query/QuerySession.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_SESSION_H

#include "clang/AST/ASTTypeTraits.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
Expand All @@ -25,7 +26,7 @@ class QuerySession {
QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
: ASTs(ASTs), PrintOutput(false), DiagOutput(true),
DetailedASTOutput(false), BindRoot(true), PrintMatcher(false),
Terminate(false) {}
Terminate(false), TK(ast_type_traits::TK_IgnoreUnlessSpelledInSource) {}

llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;

Expand All @@ -36,6 +37,8 @@ class QuerySession {
bool BindRoot;
bool PrintMatcher;
bool Terminate;

ast_type_traits::TraversalKind TK;
llvm::StringMap<ast_matchers::dynamic::VariantValue> NamedValues;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer,
// for those accesses Sema::PerformObjectMemberConversion always inserts an
// UncheckedDerivedToBase ImplicitCastExpr between the this expr and the
// object expression
auto FoundExprs =
match(findAll(memberExpr(hasObjectExpression(cxxThisExpr())).bind("ME")),
*Initializer->getInit(), Context);
auto FoundExprs = match(
traverse(
TK_AsIs,
findAll(memberExpr(hasObjectExpression(cxxThisExpr())).bind("ME"))),
*Initializer->getInit(), Context);
for (BoundNodes &BN : FoundExprs)
if (auto *MemExpr = BN.getNodeAs<MemberExpr>("ME"))
if (auto *FD = dyn_cast<FieldDecl>(MemExpr->getMemberDecl()))
Expand Down
21 changes: 11 additions & 10 deletions clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ void DurationDivisionCheck::registerMatchers(MatchFinder *finder) {
const auto DurationExpr =
expr(hasType(cxxRecordDecl(hasName("::absl::Duration"))));
finder->addMatcher(
implicitCastExpr(
hasSourceExpression(ignoringParenCasts(
cxxOperatorCallExpr(hasOverloadedOperatorName("/"),
hasArgument(0, DurationExpr),
hasArgument(1, DurationExpr))
.bind("OpCall"))),
hasImplicitDestinationType(qualType(unless(isInteger()))),
unless(hasParent(cxxStaticCastExpr())),
unless(hasParent(cStyleCastExpr())),
unless(isInTemplateInstantiation())),
traverse(ast_type_traits::TK_AsIs,
implicitCastExpr(
hasSourceExpression(ignoringParenCasts(
cxxOperatorCallExpr(hasOverloadedOperatorName("/"),
hasArgument(0, DurationExpr),
hasArgument(1, DurationExpr))
.bind("OpCall"))),
hasImplicitDestinationType(qualType(unless(isInteger()))),
unless(hasParent(cxxStaticCastExpr())),
unless(hasParent(cStyleCastExpr())),
unless(isInTemplateInstantiation()))),
this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,23 @@ void FasterStrsplitDelimiterCheck::registerMatchers(MatchFinder *Finder) {

// Find uses of absl::StrSplit(..., "x") and absl::StrSplit(...,
// absl::ByAnyChar("x")) to transform them into absl::StrSplit(..., 'x').
Finder->addMatcher(callExpr(callee(functionDecl(hasName("::absl::StrSplit"))),
hasArgument(1, anyOf(ByAnyCharArg, SingleChar)),
unless(isInTemplateInstantiation()))
.bind("StrSplit"),
this);
Finder->addMatcher(
traverse(ast_type_traits::TK_AsIs,
callExpr(callee(functionDecl(hasName("::absl::StrSplit"))),
hasArgument(1, anyOf(ByAnyCharArg, SingleChar)),
unless(isInTemplateInstantiation()))
.bind("StrSplit")),
this);

// Find uses of absl::MaxSplits("x", N) and
// absl::MaxSplits(absl::ByAnyChar("x"), N) to transform them into
// absl::MaxSplits('x', N).
Finder->addMatcher(
callExpr(
callee(functionDecl(hasName("::absl::MaxSplits"))),
hasArgument(0, anyOf(ByAnyCharArg, ignoringParenCasts(SingleChar))),
unless(isInTemplateInstantiation())),
traverse(ast_type_traits::TK_AsIs,
callExpr(callee(functionDecl(hasName("::absl::MaxSplits"))),
hasArgument(0, anyOf(ByAnyCharArg,
ignoringParenCasts(SingleChar))),
unless(isInTemplateInstantiation()))),
this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ const clang::CallExpr* ProcessArgument(const Expr* Arg,
static const auto* const Strcat = new auto(hasName("::absl::StrCat"));
const auto IsStrcat = cxxBindTemporaryExpr(
has(callExpr(callee(functionDecl(*Strcat))).bind("StrCat")));
if (const auto* SubStrcatCall = selectFirst<const CallExpr>(
if (const auto *SubStrcatCall = selectFirst<const CallExpr>(
"StrCat",
match(stmt(anyOf(
cxxConstructExpr(IsAlphanum, hasArgument(0, IsStrcat)),
IsStrcat)),
match(stmt(traverse(ast_type_traits::TK_AsIs,
anyOf(cxxConstructExpr(IsAlphanum,
hasArgument(0, IsStrcat)),
IsStrcat))),
*Arg->IgnoreParenImpCasts(), *Result.Context))) {
RemoveCallLeaveArgs(SubStrcatCall, CheckResult);
return SubStrcatCall;
Expand Down
19 changes: 11 additions & 8 deletions clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ void StrCatAppendCheck::registerMatchers(MatchFinder *Finder) {
// StrCat on the RHS. The first argument of the StrCat call should be the same
// as the LHS. Ignore calls from template instantiations.
Finder->addMatcher(
cxxOperatorCallExpr(
unless(isInTemplateInstantiation()), hasOverloadedOperatorName("="),
hasArgument(0, declRefExpr(to(decl().bind("LHS")))),
hasArgument(1, IgnoringTemporaries(
callExpr(callee(StrCat), hasArgument(0, AlphaNum),
unless(HasAnotherReferenceToLhs))
.bind("Call"))))
.bind("Op"),
traverse(ast_type_traits::TK_AsIs,
cxxOperatorCallExpr(
unless(isInTemplateInstantiation()),
hasOverloadedOperatorName("="),
hasArgument(0, declRefExpr(to(decl().bind("LHS")))),
hasArgument(
1, IgnoringTemporaries(
callExpr(callee(StrCat), hasArgument(0, AlphaNum),
unless(HasAnotherReferenceToLhs))
.bind("Call"))))
.bind("Op")),
this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) {
// `absl::Hours(x)`
// where `x` is not of a built-in type.
Finder->addMatcher(
implicitCastExpr(
anyOf(hasCastKind(CK_UserDefinedConversion),
has(implicitCastExpr(hasCastKind(CK_UserDefinedConversion)))),
hasParent(callExpr(
callee(functionDecl(DurationFactoryFunction(),
unless(hasParent(functionTemplateDecl())))),
hasArgument(0, expr().bind("arg")))))
.bind("OuterExpr"),
traverse(
ast_type_traits::TK_AsIs,
implicitCastExpr(anyOf(hasCastKind(CK_UserDefinedConversion),
has(implicitCastExpr(
hasCastKind(CK_UserDefinedConversion)))),
hasParent(callExpr(
callee(functionDecl(
DurationFactoryFunction(),
unless(hasParent(functionTemplateDecl())))),
hasArgument(0, expr().bind("arg")))))
.bind("OuterExpr")),
this);
}

Expand All @@ -116,6 +119,8 @@ void UpgradeDurationConversionsCheck::check(
"implicit conversion to 'int64_t' is deprecated in this context; use an "
"explicit cast instead";

TraversalKindScope RAII(*Result.Context, ast_type_traits::TK_AsIs);

const auto *ArgExpr = Result.Nodes.getNodeAs<Expr>("arg");
SourceLocation Loc = ArgExpr->getBeginLoc();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void AssertSideEffectCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {

void AssertSideEffectCheck::registerMatchers(MatchFinder *Finder) {
auto DescendantWithSideEffect =
hasDescendant(expr(hasSideEffect(CheckFunctionCalls)));
traverse(ast_type_traits::TK_AsIs,
hasDescendant(expr(hasSideEffect(CheckFunctionCalls))));
auto ConditionWithSideEffect = hasCondition(DescendantWithSideEffect);
Finder->addMatcher(
stmt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ void BoolPointerImplicitConversionCheck::registerMatchers(MatchFinder *Finder) {
// Look for ifs that have an implicit bool* to bool conversion in the
// condition. Filter negations.
Finder->addMatcher(
ifStmt(hasCondition(findAll(implicitCastExpr(
unless(hasParent(unaryOperator(hasOperatorName("!")))),
hasSourceExpression(
expr(hasType(pointerType(pointee(booleanType()))),
ignoringParenImpCasts(declRefExpr().bind("expr")))),
hasCastKind(CK_PointerToBoolean)))),
unless(isInTemplateInstantiation()))
.bind("if"),
traverse(
ast_type_traits::TK_AsIs,
ifStmt(hasCondition(findAll(implicitCastExpr(
unless(hasParent(unaryOperator(hasOperatorName("!")))),
hasSourceExpression(expr(
hasType(pointerType(pointee(booleanType()))),
ignoringParenImpCasts(declRefExpr().bind("expr")))),
hasCastKind(CK_PointerToBoolean)))),
unless(isInTemplateInstantiation()))
.bind("if")),
this);
}

Expand Down
Loading

0 comments on commit 7b9d0cf

Please sign in to comment.