10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H 14 #include "clang/ASTMatchers/Dynamic/VariantValue.h" 15 #include "llvm/ADT/IntrusiveRefCntPtr.h" 16 #include "llvm/ADT/Optional.h" 39 struct Query : llvm::RefCountedBase<Query> {
51 typedef llvm::IntrusiveRefCntPtr<Query>
QueryRef;
90 const ast_matchers::dynamic::DynTypedMatcher &Matcher)
94 ast_matchers::dynamic::DynTypedMatcher
Matcher;
102 LetQuery(StringRef
Name,
const ast_matchers::dynamic::VariantValue &Value)
107 ast_matchers::dynamic::VariantValue
Value;
160 :
Query(Kind), Var(Var), Value(Value) {}
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
EnableOutputQuery(bool QuerySession::*Var)
static bool classof(const Query *Q)
No-op query (i.e. a blank line).
SetNonExclusiveOutputQuery(QueryKind Kind, bool QuerySession::*Var, bool Value)
SetExclusiveOutputQuery(bool QuerySession::*Var)
static bool classof(const Query *Q)
Represents the state for a particular clang-query session.
SetQuery(T QuerySession::*Var, T Value)
MatchQuery(StringRef Source, const ast_matchers::dynamic::DynTypedMatcher &Matcher)
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.
Any query which resulted in a parse error. The error message is in ErrStr.
InvalidQuery(const Twine &ErrStr)
static bool classof(const Query *Q)
llvm::IntrusiveRefCntPtr< Query > QueryRef
Query for "match MATCHER".
static constexpr llvm::StringLiteral Name
static bool classof(const Query *Q)
LetQuery(StringRef Name, const ast_matchers::dynamic::VariantValue &Value)
static bool classof(const Query *Q)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static bool classof(const Query *Q)
DisableOutputQuery(bool QuerySession::*Var)
ast_matchers::dynamic::DynTypedMatcher Matcher
Query for "set VAR VALUE".
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.
static bool classof(const Query *Q)
ast_matchers::dynamic::VariantValue Value