mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 05:40:09 +00:00
Add some explicit use of TK_AsIs
This commit is contained in:
parent
26ac5a34ba
commit
8d62eba105
@ -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()))
|
||||
|
@ -338,7 +338,7 @@ void NumberObjectConversionChecker::checkASTCodeBody(const Decl *D,
|
||||
MatchFinder F;
|
||||
Callback CB(this, BR, AM.getAnalysisDeclContext(D));
|
||||
|
||||
F.addMatcher(stmt(forEachDescendant(FinalM)), &CB);
|
||||
F.addMatcher(traverse(TK_AsIs, stmt(forEachDescendant(FinalM))), &CB);
|
||||
F.match(*D->getBody(), AM.getASTContext());
|
||||
}
|
||||
|
||||
|
@ -86,8 +86,9 @@ auto matchSortWithPointers() -> decltype(decl()) {
|
||||
)))
|
||||
))));
|
||||
|
||||
auto PointerSortM = stmt(callExpr(allOf(SortFuncM, IteratesPointerEltsM))
|
||||
).bind(WarnAtNode);
|
||||
auto PointerSortM = traverse(
|
||||
TK_AsIs,
|
||||
stmt(callExpr(allOf(SortFuncM, IteratesPointerEltsM))).bind(WarnAtNode));
|
||||
|
||||
return decl(forEachDescendant(PointerSortM));
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ TEST(ParserTest, FullParserTest) {
|
||||
Parser::parseMatcherExpression(Code, nullptr, nullptr, &Error));
|
||||
EXPECT_EQ("", Error.toStringFull());
|
||||
Matcher<Stmt> MCastStmt =
|
||||
implicitIntBooleanCast->unconditionalConvertTo<Stmt>();
|
||||
traverse(TK_AsIs, implicitIntBooleanCast->unconditionalConvertTo<Stmt>());
|
||||
EXPECT_TRUE(matches("bool X = 1;", MCastStmt));
|
||||
EXPECT_FALSE(matches("bool X = true;", MCastStmt));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user