13#ifndef LLVM_CLANG_AST_STMTVISITOR_H
14#define LLVM_CLANG_AST_STMTVISITOR_H
25#include "llvm/ADT/STLExtras.h"
26#include "llvm/Support/Casting.h"
27#include "llvm/Support/ErrorHandling.h"
34template<
template <
typename>
class Ptr,
typename ImplClass,
typename RetTy=void,
38#define PTR(CLASS) typename Ptr<CLASS>::type
39#define DISPATCH(NAME, CLASS) \
40 return static_cast<ImplClass*>(this)->Visit ## NAME( \
41 static_cast<PTR(CLASS)>(S), std::forward<ParamTys>(P)...)
48 switch (BinOp->getOpcode()) {
86 switch (UnOp->getOpcode()) {
105 switch (S->getStmtClass()) {
106 default: llvm_unreachable(
"Unknown stmt kind!");
107#define ABSTRACT_STMT(STMT)
108#define STMT(CLASS, PARENT) \
109 case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS);
110#include "clang/AST/StmtNodes.inc"
116#define STMT(CLASS, PARENT) \
117 RetTy Visit ## CLASS(PTR(CLASS) S, ParamTys... P) { DISPATCH(PARENT, PARENT); }
118#include "clang/AST/StmtNodes.inc"
122#define BINOP_FALLBACK(NAME) \
123 RetTy VisitBin ## NAME(PTR(BinaryOperator) S, ParamTys... P) { \
124 DISPATCH(BinaryOperator, BinaryOperator); \
144#define CAO_FALLBACK(NAME) \
145 RetTy VisitBin ## NAME(PTR(CompoundAssignOperator) S, ParamTys... P) { \
146 DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \
156#define UNARYOP_FALLBACK(NAME) \
157 RetTy VisitUnary ## NAME(PTR(UnaryOperator) S, ParamTys... P) { \
158 DISPATCH(UnaryOperator, UnaryOperator); \
168#undef UNARYOP_FALLBACK
182template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
184 :
public StmtVisitorBase<std::add_pointer, ImplClass, RetTy, ParamTys...> {
192template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
194 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 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),...