10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H
13 #include "clang/ASTMatchers/Dynamic/VariantValue.h"
14 #include "llvm/ADT/IntrusiveRefCntPtr.h"
15 #include "llvm/ADT/Optional.h"
36 struct Query : llvm::RefCountedBase<Query> {
48 typedef llvm::IntrusiveRefCntPtr<Query>
QueryRef;
90 ast_matchers::dynamic::DynTypedMatcher
Matcher;
101 ast_matchers::dynamic::VariantValue
Value;
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
static bool classof(const Query *Q)
No-op query (i.e. a blank line).
static bool classof(const Query *Q)
Represents the state for a particular clang-query session.
SetQuery(T QuerySession::*Var, T Value)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
static bool classof(const Query *Q)
virtual bool run(llvm::raw_ostream &OS, QuerySession &QS) const =0
Perform the query on QS and print output to OS.
static bool classof(const Query *Q)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
Any query which resulted in a parse error. The error message is in ErrStr.
InvalidQuery(const Twine &ErrStr)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
static bool classof(const Query *Q)
llvm::IntrusiveRefCntPtr< Query > QueryRef
Query for "match MATCHER".
static bool classof(const Query *Q)
LetQuery(StringRef Name, const ast_matchers::dynamic::VariantValue &Value)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
ast_matchers::dynamic::DynTypedMatcher Matcher
Query for "set VAR VALUE".
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
static bool classof(const Query *Q)
ast_matchers::dynamic::VariantValue Value
MatchQuery(const ast_matchers::dynamic::DynTypedMatcher &Matcher)