14 #ifndef LLVM_CLANG_AST_STMTVISITOR_H 15 #define LLVM_CLANG_AST_STMTVISITOR_H 25 #include "llvm/Support/Casting.h" 26 #include "llvm/Support/ErrorHandling.h" 37 template<
template <
typename>
class Ptr,
typename ImplClass,
typename RetTy=void,
41 #define PTR(CLASS) typename Ptr<CLASS>::type 42 #define DISPATCH(NAME, CLASS) \ 43 return static_cast<ImplClass*>(this)->Visit ## NAME( \ 44 static_cast<PTR(CLASS)>(S), std::forward<ParamTys>(P)...) 51 switch (BinOp->getOpcode()) {
89 switch (UnOp->getOpcode()) {
109 default: llvm_unreachable(
"Unknown stmt kind!");
110 #define ABSTRACT_STMT(STMT) 111 #define STMT(CLASS, PARENT) \ 112 case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS); 113 #include "clang/AST/StmtNodes.inc" 119 #define STMT(CLASS, PARENT) \ 120 RetTy Visit ## CLASS(PTR(CLASS) S, ParamTys... P) { DISPATCH(PARENT, PARENT); } 121 #include "clang/AST/StmtNodes.inc" 125 #define BINOP_FALLBACK(NAME) \ 126 RetTy VisitBin ## NAME(PTR(BinaryOperator) S, ParamTys... P) { \ 127 DISPATCH(BinaryOperator, BinaryOperator); \ 143 #undef BINOP_FALLBACK 147 #define CAO_FALLBACK(NAME) \ 148 RetTy VisitBin ## NAME(PTR(CompoundAssignOperator) S, ParamTys... P) { \ 149 DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \ 159 #define UNARYOP_FALLBACK(NAME) \ 160 RetTy VisitUnary ## NAME(PTR(UnaryOperator) S, ParamTys... P) { \ 161 DISPATCH(UnaryOperator, UnaryOperator); \ 171 #undef UNARYOP_FALLBACK 185 template<
typename ImplClass,
typename RetTy=void,
typename... ParamTys>
194 template<
typename ImplClass,
typename RetTy=void,
typename... ParamTys>
196 :
public StmtVisitorBase<make_const_ptr, ImplClass, RetTy, ParamTys...> {};
200 template<
class ImplClass,
template <
typename>
class Ptr,
typename RetTy>
203 #define PTR(CLASS) typename Ptr<CLASS>::type 204 #define DISPATCH(CLASS) \ 205 return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S)) 207 #define OPENMP_CLAUSE(Name, Class) \ 208 RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); } 209 #include "clang/Basic/OpenMPKinds.def" 214 default: llvm_unreachable(
"Unknown clause kind!");
215 #define OPENMP_CLAUSE(Name, Class) \ 216 case OMPC_ ## Name : return Visit ## Class(static_cast<PTR(Class)>(S)); 217 #include "clang/Basic/OpenMPKinds.def" 226 template<
class ImplClass,
typename RetTy =
void>
229 template<
class ImplClass,
typename RetTy =
void>
235 #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.
This class implements a simple visitor for OMPClause subclasses.
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)
RetTy Visit(PTR(OMPClause) S)
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
const FunctionProtoType * T
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.
This is a basic class for representing single OpenMP clause.
CompoundAssignOperator - For compound assignments (e.g.
ast_type_traits::DynTypedNode Node
Dataflow Directional Tag Classes.
StmtClass getStmtClass() const
RetTy VisitOMPClause(PTR(OMPClause) Node)
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)
RetTy Visit(PTR(Stmt) S, ParamTys... P)
#define BINOP_FALLBACK(NAME)