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"
39struct Query : llvm::RefCountedBase<Query> {
52typedef llvm::IntrusiveRefCntPtr<Query>
QueryRef;
91 const ast_matchers::dynamic::DynTypedMatcher &
Matcher)
95 ast_matchers::dynamic::DynTypedMatcher
Matcher;
108 ast_matchers::dynamic::VariantValue
Value;
192 FileQuery(StringRef File, StringRef Prefix = StringRef())
194 Prefix(!Prefix.empty() ? std::optional<std::string>(Prefix)
203 std::optional<std::string> Prefix;
Represents the state for a particular clang-query session.
llvm::IntrusiveRefCntPtr< Query > QueryRef
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
DisableOutputQuery(bool QuerySession::*Var)
static bool classof(const Query *Q)
EnableOutputQuery(bool QuerySession::*Var)
static bool classof(const Query *Q)
FileQuery(StringRef File, StringRef Prefix=StringRef())
static bool classof(const Query *Q)
static bool classof(const Query *Q)
Any query which resulted in a parse error. The error message is in ErrStr.
static bool classof(const Query *Q)
InvalidQuery(const Twine &ErrStr)
LetQuery(StringRef Name, const ast_matchers::dynamic::VariantValue &Value)
ast_matchers::dynamic::VariantValue Value
static bool classof(const Query *Q)
Query for "match MATCHER".
MatchQuery(StringRef Source, const ast_matchers::dynamic::DynTypedMatcher &Matcher)
static bool classof(const Query *Q)
ast_matchers::dynamic::DynTypedMatcher Matcher
No-op query (i.e. a blank line).
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.
StringRef RemainingContent
static bool classof(const Query *Q)
SetExclusiveOutputQuery(bool QuerySession::*Var)
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.
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.
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.
SetQuery(T QuerySession::*Var, T Value)