clang 23.0.0git
clang::interp::EvaluationResult Class Referencefinal

Defines the result of an evaluation. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/EvaluationResult.h"

Public Types

enum  ResultKind { Empty , Invalid , Valid }
using DeclTy = llvm::PointerUnion<const Decl *, const Expr *>

Public Member Functions

 EvaluationResult (const Context *Ctx)
bool empty () const
bool isInvalid () const
APValue stealAPValue ()
 Moves the APValue containing the evaluation result to the caller.
bool checkFullyInitialized (InterpState &S, const Pointer &Ptr) const
 Check that all subobjects of the given pointer have been initialized.
bool checkDynamicAllocations (InterpState &S, const Context &Ctx, const Pointer &Ptr, SourceInfo Info)
 Check that none of the blocks the given pointer (transitively) points to are dynamically allocated.
QualType getSourceType () const
void dump () const
 Dump to stderr.

Friends

class EvalEmitter
class InterpState

Detailed Description

Defines the result of an evaluation.

The Kind defined if the evaluation was invalid, valid (but empty, e.g. for void expressions) or if we have a valid evaluation result.

We use this class to inspect and diagnose the result, as well as convert it to the requested form.

Definition at line 31 of file EvaluationResult.h.

Member Typedef Documentation

◆ DeclTy

using clang::interp::EvaluationResult::DeclTy = llvm::PointerUnion<const Decl *, const Expr *>

Definition at line 39 of file EvaluationResult.h.

Member Enumeration Documentation

◆ ResultKind

Enumerator
Empty 
Invalid 
Valid 

Definition at line 33 of file EvaluationResult.h.

Constructor & Destructor Documentation

◆ EvaluationResult()

clang::interp::EvaluationResult::EvaluationResult ( const Context * Ctx)
inline

Definition at line 69 of file EvaluationResult.h.

Member Function Documentation

◆ checkDynamicAllocations()

bool clang::interp::EvaluationResult::checkDynamicAllocations ( InterpState & S,
const Context & Ctx,
const Pointer & Ptr,
SourceInfo Info )

◆ checkFullyInitialized()

◆ dump()

LLVM_DUMP_METHOD void EvaluationResult::dump ( ) const

Dump to stderr.

Definition at line 649 of file Disasm.cpp.

References empty(), and isInvalid().

◆ empty()

bool clang::interp::EvaluationResult::empty ( ) const
inline

Definition at line 74 of file EvaluationResult.h.

References Empty.

Referenced by checkFullyInitialized(), and dump().

◆ getSourceType()

QualType clang::interp::EvaluationResult::getSourceType ( ) const
inline

Definition at line 87 of file EvaluationResult.h.

◆ isInvalid()

bool clang::interp::EvaluationResult::isInvalid ( ) const
inline

Definition at line 75 of file EvaluationResult.h.

References Invalid.

◆ stealAPValue()

APValue clang::interp::EvaluationResult::stealAPValue ( )
inline

Moves the APValue containing the evaluation result to the caller.

Definition at line 78 of file EvaluationResult.h.

◆ EvalEmitter

friend class EvalEmitter
friend

Definition at line 99 of file EvaluationResult.h.

References EvalEmitter.

Referenced by EvalEmitter.

◆ InterpState

friend class InterpState
friend

Definition at line 100 of file EvaluationResult.h.

References InterpState.

Referenced by checkDynamicAllocations(), checkFullyInitialized(), and InterpState.


The documentation for this class was generated from the following files: