Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASTMatchers][NFC] use Matcher<QualType> instead of DynTypedMatcher in TypeLocTypeMatcher #123450

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Lex/Lexer.h"

using namespace clang::ast_matchers;
Expand Down
5 changes: 2 additions & 3 deletions clang/include/clang/ASTMatchers/ASTMatchersInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ class LocMatcher : public MatcherInterface<TLoc> {
///
/// Used to implement the \c loc() matcher.
class TypeLocTypeMatcher : public MatcherInterface<TypeLoc> {
DynTypedMatcher InnerMatcher;
Matcher<QualType> InnerMatcher;

public:
explicit TypeLocTypeMatcher(const Matcher<QualType> &InnerMatcher)
Expand All @@ -1814,8 +1814,7 @@ class TypeLocTypeMatcher : public MatcherInterface<TypeLoc> {
BoundNodesTreeBuilder *Builder) const override {
if (!Node)
return false;
return this->InnerMatcher.matches(DynTypedNode::create(Node.getType()),
Finder, Builder);
return this->InnerMatcher.matches(Node.getType(), Finder, Builder);
}
};

Expand Down
Loading