13#ifndef LLVM_CLANG_AST_INTERP_STATE_H
14#define LLVM_CLANG_AST_INTERP_STATE_H
115 return keepEvaluatingAfterUndefinedBehavior();
131 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
132 unsigned ExtraNotes = 0);
136 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
137 unsigned ExtraNotes = 0);
141 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
142 unsigned ExtraNotes = 0);
151 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
152 unsigned ExtraNotes = 0);
156 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
157 unsigned ExtraNotes = 0);
161 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
162 unsigned ExtraNotes = 0);
197 bool HasActiveDiagnostic =
false;
201 bool HasFoldFailureDiagnostic =
false;
203 void addCallStack(
unsigned Limit);
208 unsigned ExtraNotes,
bool IsCCEDiag);
211 bool keepEvaluatingAfterUndefinedBehavior()
const;
219 bool hasPriorDiagnostic();
221 void setFoldFailureDiagnostic(
bool Flag) { HasFoldFailureDiagnostic = Flag; };
222 void setActiveDiagnostic(
bool Flag) { HasActiveDiagnostic = Flag; };
223 bool hasActiveDiagnostic()
const {
return HasActiveDiagnostic; }
Defines the clang::ASTContext interface.
Implements a partial diagnostic which may not be emitted.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A little helper class used to produce diagnostics.
This represents one expression.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A partial diagnostic which we might know in advance that we are not going to emit.
Encodes a location in the source.
Base class for stack frames, shared between VM and walker.
Describes the statement/declaration an opcode was generated from.
bool checkingForUndefinedBehavior() const
Are we checking an expression for overflow?
virtual const Frame * getCurrentFrame()=0
virtual bool stepsLeft() const =0
Expr::EvalStatus & getEvalStatus() const
DiagnosticBuilder report(SourceLocation Loc, diag::kind DiagId)
Directly reports a diagnostic message.
OptionalDiagnostic FFDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
Diagnose that the evaluation could not be folded (FF => FoldFailure)
State(ASTContext &ASTCtx, Expr::EvalStatus &EvalStatus)
bool CheckingPotentialConstantExpression
Whether we're checking that an expression is a potential constant expression.
virtual unsigned getCallStackDepth()=0
bool CheckingForUndefinedBehavior
Whether we're checking for an expression that has undefined behavior.
bool noteSideEffect() const
Note that we have had a side-effect, and determine whether we should keep evaluating.
Expr::EvalStatus & EvalStatus
ASTContext & getASTContext() const
bool noteUndefinedBehavior() const
Note that we hit something that was technically undefined behavior, but that we can evaluate past it ...
void addNotes(ArrayRef< PartialDiagnosticAt > Diags)
Add a stack of notes to a prior diagnostic.
virtual const Frame * getBottomFrame() const =0
OptionalDiagnostic CCEDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
Diagnose that the evaluation does not produce a C++11 core constant expression.
const LangOptions & getLangOpts() const
bool checkingPotentialConstantExpression() const
Are we checking whether the expression is a potential constant expression?
bool keepEvaluatingAfterSideEffect() const
Should we continue evaluation after encountering a side-effect that we couldn't model?
bool keepEvaluatingAfterFailure() const
Should we continue evaluation as much as possible after encountering a construct which can't be reduc...
bool InConstantContext
Whether or not we're in a context where the front end requires a constant value.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
The JSON file list parser is used to communicate input to InstallAPI.
CheckSubobjectKind
The order of this enum is important for diagnostics.
AccessKinds
Kinds of access we can perform on an object, for diagnostics.
@ AK_ReadObjectRepresentation
@ ConstantFold
Fold the expression to a constant.
@ ConstantExpressionUnevaluated
Evaluate as a constant expression.
@ ConstantExpression
Evaluate as a constant expression.
@ IgnoreSideEffects
Evaluate in any way we know how.
EvalStatus is a struct with detailed info about an evaluation in progress.