9#ifndef LLVM_CLANG_AST_INTERP_EVALUATION_RESULT_H
10#define LLVM_CLANG_AST_INTERP_EVALUATION_RESULT_H
42 using DeclTy = llvm::PointerUnion<const Decl *, const Expr *>;
46 std::variant<std::monostate, Pointer, FunctionPointer, APValue>
Value;
56 void setSource(
DeclTy D) { Source =
D; }
64 void setPointer(
const Pointer
P) {
69 void setFunctionPointer(
const FunctionPointer &
P) {
99 std::optional<APValue>
toRValue()
const;
110 dyn_cast_if_present<ValueDecl>(Source.dyn_cast<
const Decl *>()))
112 else if (
const auto *
E = Source.dyn_cast<
const Expr *>())
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
A (possibly-)qualified type.
Holds all information required to evaluate constexpr code in a module.
An emitter which evaluates opcodes as they are emitted.
Defines the result of an evaluation.
std::optional< APValue > toRValue() const
If the result is an LValue, convert that to an RValue and return it.
APValue toAPValue() const
Returns an APValue for the evaluation result.
QualType getSourceType() const
bool checkReturnValue(InterpState &S, const Context &Ctx, const Pointer &Ptr, const SourceInfo &Info)
Check that none of the blocks the given pointer (transitively) points to are dynamically allocated.
llvm::PointerUnion< const Decl *, const Expr * > DeclTy
bool checkFullyInitialized(InterpState &S, const Pointer &Ptr) const
Check that all subobjects of the given pointer have been initialized.
EvaluationResult(const Context *Ctx)
void dump() const
Dump to stderr.
A pointer to a memory block, live or dead.
Describes the statement/declaration an opcode was generated from.
llvm::PointerUnion< const Decl *, const Expr * > DeclTy
The JSON file list parser is used to communicate input to InstallAPI.