|
clang 24.0.0git
|
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 } |
Public Member Functions | |
| EvaluationResult (const Context &Ctx) | |
| bool | empty () const |
| bool | isInvalid () const |
| APValue | stealAPValue () |
| bool | checkFullyInitialized (InterpState &S, const Pointer &Ptr) const |
| Check that all subobjects of the given pointer have been initialized. | |
| bool | checkDynamicAllocations (InterpState &S, const Pointer &Ptr, SourceInfo Info) const |
| Check that none of the blocks the given pointer (transitively) points to are dynamically allocated. | |
| bool | checkLValue (InterpState &S, const Pointer &Ptr, SourceInfo Info, ConstantExprKind ConstexprKind) const |
| Check the given pointer as an lvalue, i.e. | |
| bool | checkLValueFields (InterpState &S, const Pointer &Ptr, SourceInfo Info, ConstantExprKind ConstexprKind) const |
| Check all fields of the given pointer. | |
| bool | checkFunctionPointer (InterpState &S, const Pointer &Ptr, SourceInfo Info, ConstantExprKind ConstexprKind) const |
| Check if the given function pointer can be returned from an evaluation. | |
| QualType | getSourceType () const |
| void | dump () const |
| Dump to stderr. | |
Static Public Member Functions | |
| static bool | checkMemberPointer (InterpState &S, const MemberPointer &MemberPtr, SourceInfo Info, ConstantExprKind ConstexprKind) |
| Check if the given member pointer can be returned from an evaluation. | |
Friends | |
| class | EvalEmitter |
| class | InterpState |
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 33 of file EvaluationResult.h.
| Enumerator | |
|---|---|
| Empty | |
| Invalid | |
| Valid | |
Definition at line 35 of file EvaluationResult.h.
|
inline |
Definition at line 68 of file EvaluationResult.h.
| bool clang::interp::EvaluationResult::checkDynamicAllocations | ( | InterpState & | S, |
| const Pointer & | Ptr, | ||
| SourceInfo | Info ) const |
Check that none of the blocks the given pointer (transitively) points to are dynamically allocated.
Definition at line 264 of file EvaluationResult.cpp.
References clang::interp::collectBlocks(), clang::interp::State::FFDiag(), InterpState, and clang::interp::State::Note().
| bool clang::interp::EvaluationResult::checkFullyInitialized | ( | InterpState & | S, |
| const Pointer & | Ptr ) const |
Check that all subobjects of the given pointer have been initialized.
Definition at line 152 of file EvaluationResult.cpp.
References clang::cast(), clang::interp::CheckArrayInitialized(), clang::interp::CheckFieldsInitialized(), empty(), and InterpState.
| bool clang::interp::EvaluationResult::checkFunctionPointer | ( | InterpState & | S, |
| const Pointer & | Ptr, | ||
| SourceInfo | Info, | ||
| ConstantExprKind | ConstexprKind ) const |
Check if the given function pointer can be returned from an evaluation.
Definition at line 648 of file EvaluationResult.cpp.
References clang::interp::checkFunctionPtr(), and InterpState.
| bool clang::interp::EvaluationResult::checkLValue | ( | InterpState & | S, |
| const Pointer & | Ptr, | ||
| SourceInfo | Info, | ||
| ConstantExprKind | ConstexprKind ) const |
Check the given pointer as an lvalue, i.e.
make sure it's a global lvalue and diagnose if it's not.
Definition at line 553 of file EvaluationResult.cpp.
References clang::interp::checkFunctionPtr(), clang::interp::State::FFDiag(), clang::interp::State::getASTContext(), InterpState, clang::Type::isReferenceType(), isTemplateArgument(), and clang::interp::lval().
| bool clang::interp::EvaluationResult::checkLValueFields | ( | InterpState & | S, |
| const Pointer & | Ptr, | ||
| SourceInfo | Info, | ||
| ConstantExprKind | ConstexprKind ) const |
Check all fields of the given pointer.
Toplevel accessor to check all lvalue fields.
Definition at line 540 of file EvaluationResult.cpp.
References clang::interp::State::getASTContext(), InterpState, and clang::interp::lvalFields().
|
static |
Check if the given member pointer can be returned from an evaluation.
Definition at line 626 of file EvaluationResult.cpp.
References clang::interp::State::FFDiag(), clang::Decl::getLocation(), clang::Decl::hasAttr(), InterpState, isForManglingOnly(), clang::FunctionDecl::isImmediateFunction(), clang::CXXMethodDecl::isVirtual(), and clang::interp::State::Note().
Referenced by clang::interp::lvalFields().
| LLVM_DUMP_METHOD void EvaluationResult::dump | ( | ) | const |
|
inline |
Definition at line 70 of file EvaluationResult.h.
References Empty.
Referenced by checkFullyInitialized(), and dump().
|
inline |
Definition at line 98 of file EvaluationResult.h.
|
inline |
Definition at line 71 of file EvaluationResult.h.
References Invalid.
|
inline |
Definition at line 73 of file EvaluationResult.h.
|
friend |
Definition at line 109 of file EvaluationResult.h.
References EvalEmitter.
Referenced by EvalEmitter.
|
friend |
Definition at line 110 of file EvaluationResult.h.
References InterpState.
Referenced by checkDynamicAllocations(), checkFullyInitialized(), checkFunctionPointer(), checkLValue(), checkLValueFields(), checkMemberPointer(), and InterpState.