13#ifndef LLVM_CLANG_AST_INTERP_STATE_H
14#define LLVM_CLANG_AST_INTERP_STATE_H
117 return keepEvaluatingAfterUndefinedBehavior();
133 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
134 unsigned ExtraNotes = 0);
138 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
139 unsigned ExtraNotes = 0);
143 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
144 unsigned ExtraNotes = 0);
153 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
154 unsigned ExtraNotes = 0);
158 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
159 unsigned ExtraNotes = 0);
163 diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr,
164 unsigned ExtraNotes = 0);
200 bool HasActiveDiagnostic =
false;
204 bool HasFoldFailureDiagnostic =
false;
206 void addCallStack(
unsigned Limit);
213 unsigned ExtraNotes,
bool IsCCEDiag);
216 bool keepEvaluatingAfterUndefinedBehavior()
const;
224 bool hasPriorDiagnostic();
226 void setFoldFailureDiagnostic(
bool Flag) { HasFoldFailureDiagnostic = Flag; };
227 void setActiveDiagnostic(
bool Flag) { HasActiveDiagnostic = Flag; };
228 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.
bool emitRelaxedDiag(SourceLocation Loc, diag::kind DiagId)
If DiagId should be relaxed as per the current evaluation settings, emit it as a warning instead of a...
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.
OptionalDiagnostic Note(SourceInfo Loc, diag::kind DiagId)
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.
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.
Top level wrappers for InstallAPI frontend operations.
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.