[ASTMatchers][NFC] use Matcher<QualType>
instead of DynTypedMatcher
in TypeLocTypeMatcher
(#123450)
There are no template in `TypeLocTypeMatcher`. So we do not need to use `DynTypedMatcher` which can improve performance
This commit is contained in:
parent
ac94fade60
commit
68c6b2e188
@ -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;
|
||||
|
@ -1804,7 +1804,7 @@ private:
|
||||
///
|
||||
/// Used to implement the \c loc() matcher.
|
||||
class TypeLocTypeMatcher : public MatcherInterface<TypeLoc> {
|
||||
DynTypedMatcher InnerMatcher;
|
||||
Matcher<QualType> InnerMatcher;
|
||||
|
||||
public:
|
||||
explicit TypeLocTypeMatcher(const Matcher<QualType> &InnerMatcher)
|
||||
@ -1814,8 +1814,7 @@ public:
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user