13 #ifndef LLVM_CLANG_AST_STMTVISITOR_H 14 #define LLVM_CLANG_AST_STMTVISITOR_H 24 #include "llvm/ADT/STLExtras.h" 25 #include "llvm/Support/Casting.h" 26 #include "llvm/Support/ErrorHandling.h" 33 template<
template <
typename>
class Ptr,
typename ImplClass,
typename RetTy=void,
37 #define PTR(CLASS) typename Ptr<CLASS>::type 38 #define DISPATCH(NAME, CLASS) \ 39 return static_cast<ImplClass*>(this)->Visit ## NAME( \ 40 static_cast<PTR(CLASS)>(S), std::forward<ParamTys>(P)...) 47 switch (BinOp->getOpcode()) {
85 switch (UnOp->getOpcode()) {
105 default: llvm_unreachable(
"Unknown stmt kind!");
106 #define ABSTRACT_STMT(STMT) 107 #define STMT(CLASS, PARENT) \ 108 case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS); 109 #include "clang/AST/StmtNodes.inc" 115 #define STMT(CLASS, PARENT) \ 116 RetTy Visit ## CLASS(PTR(CLASS) S, ParamTys... P) { DISPATCH(PARENT, PARENT); } 117 #include "clang/AST/StmtNodes.inc" 121 #define BINOP_FALLBACK(NAME) \ 122 RetTy VisitBin ## NAME(PTR(BinaryOperator) S, ParamTys... P) { \ 123 DISPATCH(BinaryOperator, BinaryOperator); \ 139 #undef BINOP_FALLBACK 143 #define CAO_FALLBACK(NAME) \ 144 RetTy VisitBin ## NAME(PTR(CompoundAssignOperator) S, ParamTys... P) { \ 145 DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \ 155 #define UNARYOP_FALLBACK(NAME) \ 156 RetTy VisitUnary ## NAME(PTR(UnaryOperator) S, ParamTys... P) { \ 157 DISPATCH(UnaryOperator, UnaryOperator); \ 167 #undef UNARYOP_FALLBACK 181 template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
183 :
public StmtVisitorBase<std::add_pointer, ImplClass, RetTy, ParamTys...> {
191 template <
typename ImplClass,
typename RetTy = void,
typename... ParamTys>
193 RetTy, ParamTys...> {};
197 #endif // LLVM_CLANG_AST_STMTVISITOR_H #define CAO_FALLBACK(NAME)
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Defines the Objective-C statement AST node classes.
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
A builtin binary operation expression such as "x + y" or "x <= y".
#define DISPATCH(NAME, CLASS)
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
CompoundAssignOperator - For compound assignments (e.g.
ast_type_traits::DynTypedNode Node
Dataflow Directional Tag Classes.
StmtClass getStmtClass() const
StmtVisitorBase - This class implements a simple visitor for Stmt subclasses.
This file defines OpenMP AST classes for executable directives and clauses.
#define UNARYOP_FALLBACK(NAME)
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
ASTImporterLookupTable & LT
RetTy Visit(PTR(Stmt) S, ParamTys... P)