clang  6.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::Expr::EvalStatus Struct Reference

EvalStatus is a struct with detailed info about an evaluation in progress. More...

#include "clang/AST/Expr.h"

Inheritance diagram for clang::Expr::EvalStatus:
Inheritance graph
[legend]
Collaboration diagram for clang::Expr::EvalStatus:
Collaboration graph
[legend]

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...
 

Detailed Description

EvalStatus is a struct with detailed info about an evaluation in progress.

Definition at line 541 of file Expr.h.

Constructor & Destructor Documentation

◆ EvalStatus()

clang::Expr::EvalStatus::EvalStatus ( )
inline

Definition at line 560 of file Expr.h.

Member Function Documentation

◆ hasSideEffects()

bool clang::Expr::EvalStatus::hasSideEffects ( ) const
inline

Definition at line 565 of file Expr.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().

Member Data Documentation

◆ Diag

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 558 of file Expr.h.

Referenced by CheckConvertedConstantExpression(), clang::Expr::EvaluateAsInitializer(), and isNullPointerValueTemplateArgument().

◆ HasSideEffects

bool clang::Expr::EvalStatus::HasSideEffects

◆ HasUndefinedBehavior

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 549 of file Expr.h.

Referenced by hasUnacceptableSideEffect().


The documentation for this struct was generated from the following file: