13#ifndef LLVM_CLANG_AST_STMTVISITOR_H
14#define LLVM_CLANG_AST_STMTVISITOR_H
26#include "llvm/ADT/STLExtras.h"
27#include "llvm/Support/Casting.h"
28#include "llvm/Support/ErrorHandling.h"
35template<
template <
typename>
class Ptr,
typename ImplClass,
typename RetTy=void,
39#define PTR(CLASS) typename Ptr<CLASS>::type
40#define DISPATCH(NAME, CLASS) \
41 return static_cast<ImplClass*>(this)->Visit ## NAME( \
42 static_cast<PTR(CLASS)>(S), std::forward<ParamTys>(P)...)
49 switch (BinOp->getOpcode()) {
87 switch (UnOp->getOpcode()) {
106 switch (S->getStmtClass()) {
107 default: llvm_unreachable(
"Unknown stmt kind!");
108#define ABSTRACT_STMT(STMT)
109#define STMT(CLASS, PARENT) \
110 case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS);
111#include "clang/AST/StmtNodes.inc"
117#define STMT(CLASS, PARENT) \
118 RetTy Visit ## CLASS(PTR(CLASS) S, ParamTys... P) { DISPATCH(PARENT, PARENT); }
119#include "clang/AST/StmtNodes.inc"
123#define BINOP_FALLBACK(NAME) \
124 RetTy VisitBin ## NAME(PTR(BinaryOperator) S, ParamTys... P) { \
125 DISPATCH(BinaryOperator, BinaryOperator); \
145#define CAO_FALLBACK(NAME) \
146 RetTy VisitBin ## NAME(PTR(CompoundAssignOperator) S, ParamTys... P) { \
147 DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \
157#define UNARYOP_FALLBACK(NAME) \
158 RetTy VisitUnary ## NAME(PTR(UnaryOperator) S, ParamTys... P) { \
159 DISPATCH(UnaryOperator, UnaryOperator); \
169#undef UNARYOP_FALLBACK
183template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
185 :
public StmtVisitorBase<std::add_pointer, ImplClass, RetTy, ParamTys...> {
193template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
195 RetTy, ParamTys...> {};
ASTImporterLookupTable & LT
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines Expressions and AST nodes for C++2a concepts.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the Objective-C statement AST node classes.
This file defines OpenACC AST classes for statement-level contructs.
This file defines OpenMP AST classes for executable directives and clauses.
#define UNARYOP_FALLBACK(NAME)
#define BINOP_FALLBACK(NAME)
#define CAO_FALLBACK(NAME)
A builtin binary operation expression such as "x + y" or "x <= y".
CompoundAssignOperator - For compound assignments (e.g.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
StmtVisitorBase - This class implements a simple visitor for Stmt subclasses.
BINOP_FALLBACK(PtrMemD) BINOP_FALLBACK(PtrMemI) BINOP_FALLBACK(Mul) BINOP_FALLBACK(Div) BINOP_FALLBACK(Rem) BINOP_FALLBACK(Add) BINOP_FALLBACK(Sub) BINOP_FALLBACK(Shl) BINOP_FALLBACK(LT) BINOP_FALLBACK(GT) BINOP_FALLBACK(LE) BINOP_FALLBACK(GE) BINOP_FALLBACK(EQ) BINOP_FALLBACK(NE) BINOP_FALLBACK(And) BINOP_FALLBACK(Xor) BINOP_FALLBACK(Or) BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec) UNARYOP_FALLBACK(PreInc) UNARYOP_FALLBACK(PreDec) UNARYOP_FALLBACK(AddrOf) UNARYOP_FALLBACK(Deref) UNARYOP_FALLBACK(Plus) UNARYOP_FALLBACK(Minus) UNARYOP_FALLBACK(Not) UNARYOP_FALLBACK(LNot) UNARYOP_FALLBACK(Real) UNARYOP_FALLBACK(Imag) UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(Coawait) RetTy VisitStmt(PTR(Stmt) Node
RetTy Visit(PTR(Stmt) S, ParamTys... P)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
The JSON file list parser is used to communicate input to InstallAPI.