14#ifndef LLVM_CLANG_AST_EVALUATEDEXPRVISITOR_H
15#define LLVM_CLANG_AST_EVALUATEDEXPRVISITOR_H
21#include "llvm/ADT/STLExtras.h"
29template<
template <
typename>
class Ptr,
typename ImplClass>
38#define PTR(CLASS) typename Ptr<CLASS>::type
59 if (
E->getCond()->isValueDependent())
69 if (
E->isResultDependent())
83 if (
E->isPotentiallyEvaluated())
95 E = LE->capture_init_end();
104 for (
auto *SubStmt : S->children())
106 this->
Visit(SubStmt);
111 if (
auto SubStmt =
If->getNondiscardedCase(
Context)) {
113 this->
Visit(*SubStmt);
121 ImplClass &
getDerived() {
return *
static_cast<ImplClass *
>(
this); }
127template <
typename ImplClass>
136template <
typename ImplClass>
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::Expr interface and subclasses for C++ expressions.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Expr * getExprOperand() const
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
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...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
ConstEvaluatedExprVisitor - This class visits 'const Expr *'s.
ConstEvaluatedExprVisitor(const ASTContext &Context)
A reference to a declared variable, function, enum, etc.
Represents a C99 designated initializer expression.
Expr * getInit() const
Retrieve the initializer value.
Given a potentially-evaluated expression, this visitor visits all of its potentially-evaluated subexp...
void VisitBlockExpr(PTR(BlockExpr) E)
EvaluatedExprVisitorBase(const ASTContext &Context)
bool shouldVisitDiscardedStmt() const
void VisitStmt(PTR(Stmt) S)
The basis case walks all of the children of the statement or expression, assuming they are all potent...
void VisitExpressionTraitExpr(PTR(ExpressionTraitExpr) E)
void VisitCXXNoexceptExpr(PTR(CXXNoexceptExpr) E)
void VisitMemberExpr(PTR(MemberExpr) E)
void VisitCallExpr(PTR(CallExpr) CE)
void VisitCXXUuidofExpr(PTR(CXXUuidofExpr) E)
void VisitCXXTypeidExpr(PTR(CXXTypeidExpr) E)
void VisitGenericSelectionExpr(PTR(GenericSelectionExpr) E)
void VisitDeclRefExpr(PTR(DeclRefExpr) E)
void VisitOffsetOfExpr(PTR(OffsetOfExpr) E)
void VisitIfStmt(PTR(IfStmt) If)
void VisitDesignatedInitExpr(PTR(DesignatedInitExpr) E)
void VisitUnaryExprOrTypeTraitExpr(PTR(UnaryExprOrTypeTraitExpr) E)
void VisitChooseExpr(PTR(ChooseExpr) E)
void VisitLambdaExpr(PTR(LambdaExpr) LE)
const ASTContext & Context
EvaluatedExprVisitor - This class visits 'Expr *'s.
EvaluatedExprVisitor(const ASTContext &Context)
An expression trait intrinsic.
Represents a C11 generic selection.
Expr * getResultExpr()
Return the result expression of this controlling expression.
IfStmt - This represents an if/then/else.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
StmtVisitorBase - This class implements a simple visitor for Stmt subclasses.
void Visit(PTR(Stmt) S, ParamTys... P)
Stmt - This represents one statement.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
The JSON file list parser is used to communicate input to InstallAPI.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
Diagnostic wrappers for TextAPI types for error reporting.