clang
10.0.0git
|
EvalStatus is a struct with detailed info about an evaluation in progress. More...
#include "clang/AST/Expr.h"
Public Member Functions | |
EvalStatus () | |
bool | hasSideEffects () const |
Public Attributes | |
bool | HasSideEffects |
Whether the evaluated expression has side effects. More... | |
bool | HasUndefinedBehavior |
Whether the evaluation hit undefined behavior. More... | |
SmallVectorImpl< PartialDiagnosticAt > * | Diag |
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation failed (or why it failed to produce a constant expression). More... | |
EvalStatus is a struct with detailed info about an evaluation in progress.
|
inline |
Definition at line 580 of file Expr.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
SmallVectorImpl<PartialDiagnosticAt>* clang::Expr::EvalStatus::Diag |
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation failed (or why it failed to produce a constant expression).
If the expression is unfoldable, the notes will indicate why it's not foldable. If the expression is foldable, but not a constant expression, the notes will describes why it isn't a constant expression. If the expression is a constant expression, no notes will be produced.
Definition at line 573 of file Expr.h.
Referenced by clang::interp::State::addNotes(), CheckConvertedConstantExpression(), clang::Expr::EvaluateAsInitializer(), clang::VarDecl::evaluateDestruction(), isNullPointerValueTemplateArgument(), and clang::interp::State::report().
bool clang::Expr::EvalStatus::HasSideEffects |
Whether the evaluated expression has side effects.
For example, (f() && 0) can be folded, but it still has side effects.
Definition at line 559 of file Expr.h.
Referenced by clang::Expr::EvaluateAsInitializer(), clang::VarDecl::evaluateDestruction(), hasUnacceptableSideEffect(), clang::Expr::isConstantInitializer(), isNullPointerValueTemplateArgument(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
bool clang::Expr::EvalStatus::HasUndefinedBehavior |
Whether the evaluation hit undefined behavior.
For example, 1.0 / 0.0 can be folded to Inf, but has undefined behavior. Likewise, INT_MAX + 1 can be folded to INT_MIN, but has UB.
Definition at line 564 of file Expr.h.
Referenced by hasUnacceptableSideEffect().