Go to the documentation of this file.
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_H
10 #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"
39 struct Query : llvm::RefCountedBase<Query> {
52 typedef llvm::IntrusiveRefCntPtr<Query>
QueryRef;
91 const ast_matchers::dynamic::DynTypedMatcher &
Matcher)
95 ast_matchers::dynamic::DynTypedMatcher
Matcher;
108 ast_matchers::dynamic::VariantValue
Value;
llvm::IntrusiveRefCntPtr< Query > QueryRef
ast_matchers::dynamic::VariantValue Value
SetNonExclusiveOutputQuery(QueryKind Kind, bool QuerySession::*Var, bool Value)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
MatchQuery(StringRef Source, const ast_matchers::dynamic::DynTypedMatcher &Matcher)
Any query which resulted in a parse error. The error message is in ErrStr.
EnableOutputQuery(bool QuerySession::*Var)
LetQuery(StringRef Name, const ast_matchers::dynamic::VariantValue &Value)
InvalidQuery(const Twine &ErrStr)
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
SetExclusiveOutputQuery(bool QuerySession::*Var)
static bool classof(const Query *Q)
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.
SetQuery(T QuerySession::*Var, T Value)
DisableOutputQuery(bool QuerySession::*Var)
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)
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.
Query for "match MATCHER".
StringRef RemainingContent
static bool classof(const Query *Q)
static bool classof(const Query *Q)
static bool classof(const Query *Q)
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.
bool run(llvm::raw_ostream &OS, QuerySession &QS) const override
Perform the query on QS and print output to OS.
No-op query (i.e. a blank line).
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::raw_string_ostream OS
static bool classof(const Query *Q)
ast_matchers::dynamic::DynTypedMatcher Matcher
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.
static bool classof(const Query *Q)
Represents the state for a particular clang-query session.