Go to the documentation of this file.
14 #ifndef LLVM_CLANG_AST_EVALUATEDEXPRVISITOR_H
15 #define LLVM_CLANG_AST_EVALUATEDEXPRVISITOR_H
21 #include "llvm/ADT/STLExtras.h"
29 template<
template <
typename>
class Ptr,
typename ImplClass>
38 #define PTR(CLASS) typename Ptr<CLASS>::type
95 E =
LE->capture_init_end();
104 for (
auto *SubStmt : S->children())
106 this->
Visit(SubStmt);
113 this->
Visit(*SubStmt);
121 ImplClass &
getDerived() {
return *
static_cast<ImplClass *
>(
this); }
127 template <
typename ImplClass>
136 template <
typename ImplClass>
145 #endif // LLVM_CLANG_AST_EVALUATEDEXPRVISITOR_H
An expression trait intrinsic.
YAML serialization mapping.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
void VisitExpressionTraitExpr(PTR(ExpressionTraitExpr) E)
Represents a C99 designated initializer expression.
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr....
void VisitCXXNoexceptExpr(PTR(CXXNoexceptExpr) E)
void VisitDeclRefExpr(PTR(DeclRefExpr) E)
void VisitLambdaExpr(PTR(LambdaExpr) LE)
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
IfStmt - This represents an if/then/else.
Given a potentially-evaluated expression, this visitor visits all of its potentially-evaluated subexp...
Optional< const Stmt * > getNondiscardedCase(const ASTContext &Ctx) const
If this is an 'if constexpr', determine which substatement will be taken.
void VisitChooseExpr(PTR(ChooseExpr) E)
Expr * getExprOperand() const
EvaluatedExprVisitor(const ASTContext &Context)
void VisitGenericSelectionExpr(PTR(GenericSelectionExpr) E)
void VisitCXXUuidofExpr(PTR(CXXUuidofExpr) E)
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
bool shouldVisitDiscardedStmt() const
ConstEvaluatedExprVisitor(const ASTContext &Context)
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
bool LE(InterpState &S, CodePtr OpPC)
void VisitIfStmt(PTR(IfStmt) If)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
EvaluatedExprVisitorBase(const ASTContext &Context)
void Visit(PTR(Stmt) S, ParamTys... P)
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
StmtVisitorBase - This class implements a simple visitor for Stmt subclasses.
void VisitCXXTypeidExpr(PTR(CXXTypeidExpr) E)
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
bool isResultDependent() const
Whether this generic selection is result-dependent.
void VisitCallExpr(PTR(CallExpr) CE)
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
void VisitDesignatedInitExpr(PTR(DesignatedInitExpr) E)
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
bool isValueDependent() const
Determines whether the value of this expression depends on.
void VisitUnaryExprOrTypeTraitExpr(PTR(UnaryExprOrTypeTraitExpr) E)
Stmt - This represents one statement.
Expr * getResultExpr()
Return the result expression of this controlling expression.
Represents a C11 generic selection.
ConstEvaluatedExprVisitor - This class visits 'const Expr *'s.
void VisitBlockExpr(PTR(BlockExpr) E)
Expr * getInit() const
Retrieve the initializer value.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
void VisitStmt(PTR(Stmt) S)
The basis case walks all of the children of the statement or expression, assuming they are all potent...
void VisitMemberExpr(PTR(MemberExpr) E)
EvaluatedExprVisitor - This class visits 'Expr *'s.
void VisitOffsetOfExpr(PTR(OffsetOfExpr) E)
A reference to a declared variable, function, enum, etc.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
bool isUnevaluatedBuiltinCall(const ASTContext &Ctx) const
Returns true if this is a call to a builtin which does not evaluate side-effects within its arguments...
const ASTContext & Context