clang 22.0.0git
|
#include "clang/Interpreter/Value.h"
Classes | |
struct | convertFwd |
struct | convertFwd< T * > |
Public Types | |
enum | Kind { K_Void , K_PtrOrObj , K_Unspecified } |
Public Member Functions | |
Value ()=default | |
Value (const Interpreter *In, void *Ty) | |
Value (const Value &RHS) | |
Value (Value &&RHS) noexcept | |
Value & | operator= (const Value &RHS) |
Value & | operator= (Value &&RHS) noexcept |
~Value () | |
void | printType (llvm::raw_ostream &Out) const |
void | printData (llvm::raw_ostream &Out) const |
void | print (llvm::raw_ostream &Out) const |
void | dump () const |
void | clear () |
const ASTContext & | getASTContext () const |
const Interpreter & | getInterpreter () const |
QualType | getType () const |
bool | isValid () const |
bool | isVoid () const |
bool | hasValue () const |
bool | isManuallyAlloc () const |
Kind | getKind () const |
void | setKind (Kind K) |
void | setOpaqueType (void *Ty) |
void * | getPtr () const |
void | setPtr (void *Ptr) |
void | setRawBits (void *Ptr, unsigned NBits=sizeof(Storage)) |
template<typename T> | |
REPL_BUILTIN_TYPES T | convertTo () const |
Get the value with cast. | |
template<> | |
void * | as () const |
Protected Member Functions | |
bool | isPointerOrObjectType () const |
template<typename T> | |
T | as () const |
Get to the value with type checking casting the underlying stored value to T. |
Protected Attributes | |
const Interpreter * | Interp = nullptr |
void * | OpaqueType = nullptr |
Storage | Data |
Kind | ValueKind = K_Unspecified |
bool | IsManuallyAlloc = false |
enum clang::Value::Kind |
|
default |
References clear(), getASTContext(), getInterpreter(), operator=(), printData(), printType(), and Value().
Referenced by clang::Value::convertFwd< T >::cast(), clang::Value::convertFwd< T * >::cast(), findValueTableByValue(), operator=(), operator=(), Value(), Value(), Value(), and clang::ValueRef::ValueRef().
clang::Value::Value | ( | const Interpreter * | In, |
void * | Ty ) |
Definition at line 123 of file Value.cpp.
References clang::Addr, clang::C, clang::ConvertQualTypeToKind(), clang::Type::getAsCXXRecordDecl(), getASTContext(), clang::QualType::getCanonicalType(), getInterpreter(), clang::CharUnits::getQuantity(), getType(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSizeInChars(), Interp, clang::Type::isConstantArrayType(), IsManuallyAlloc, clang::Type::isMemberPointerType(), clang::Type::isObjectType(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), K_PtrOrObj, OpaqueType, setKind(), setPtr(), and ValueKind.
clang::Value::Value | ( | const Value & | RHS | ) |
Definition at line 167 of file Value.cpp.
References Data, getPtr(), Interp, IsManuallyAlloc, OpaqueType, Value(), and ValueKind.
|
noexcept |
Definition at line 174 of file Value.cpp.
References Data, getPtr(), Interp, IsManuallyAlloc, K_Unspecified, OpaqueType, Value(), and ValueKind.
|
inline |
Definition at line 204 of file Value.h.
References as(), Data, and isPointerOrObjectType().
void clang::Value::clear | ( | ) |
Definition at line 216 of file Value.cpp.
References getPtr(), Interp, IsManuallyAlloc, K_Unspecified, OpaqueType, and ValueKind.
Referenced by clang::ASTContext::cleanup(), Value(), and ~Value().
|
inline |
Get the value with cast.
Get the value cast to T. This is similar to reinterpret_cast<T>(value), casting the value of builtins (except void), enums and pointers. Values referencing an object are treated as pointers to the object.
Definition at line 156 of file Value.h.
References clang::Value::convertFwd< T >::cast(), and clang::T.
const ASTContext & clang::Value::getASTContext | ( | ) | const |
Definition at line 247 of file Value.cpp.
References clang::Interpreter::getASTContext(), and getInterpreter().
const Interpreter & clang::Value::getInterpreter | ( | ) | const |
|
inline |
Definition at line 137 of file Value.h.
References ValueKind.
Referenced by __clang_Interpreter_SetValueNoAlloc(), clang::ODRHash::AddStructuralValue(), clang::ento::SimpleConstraintManager::assumeInclusiveRangeInternal(), clang::ConstantExpr::getStorageKind(), isConfigurationPattern(), isSimpleAPValue(), clang::ConstantExpr::MoveIntoResult(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::TextNodeDumper::Visit().
void * clang::Value::getPtr | ( | ) | const |
Definition at line 227 of file Value.cpp.
References Data, K_PtrOrObj, and ValueKind.
Referenced by __clang_Interpreter_SetValueWithAlloc(), clear(), operator=(), operator=(), Value(), and Value().
QualType clang::Value::getType | ( | ) | const |
Definition at line 237 of file Value.cpp.
References clang::QualType::getFromOpaquePtr(), and OpaqueType.
Referenced by __clang_Interpreter_SetValueNoAlloc(), AddResultTypeChunk(), clang::Sema::ApplyNullability(), buildFMulAdd(), clang::Sema::BuildStmtExpr(), CheckEvaluationResult(), ClassifyMemberExpr(), createCastsForTypeOfSameSize(), DeduceNonTypeTemplateArgument(), DeduceNullPtrTemplateArgument(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAArch64CompareBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAtomicStore(), clang::CodeGen::CodeGenFunction::EmitBitfieldConversionCheck(), EmitBitfieldTruncationCheckHelper(), EmitBitTestIntrinsic(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCheckedArgForBuiltin(), clang::CodeGen::CodeGenFunction::EmitDirectXBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::CodeGen::CodeGenFunction::EmitFromMemory(), EmitGEPOffsetInBytes(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), EmitIntegerSignChangeCheckHelper(), EmitIntegerTruncationCheckHelper(), EmitllvmFAbs(), clang::CodeGen::CodeGenFunction::EmitMSVCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr(), EmitOverflowCheckedAbs(), emitPointerArithmetic(), clang::CodeGen::CodeGenFunction::emitPointerAuthResign(), clang::CodeGen::CodeGenFunction::emitPointerAuthResignCall(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), emitRVVVLEFFBuiltin(), EmitScalarFMAExpr(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), clang::CodeGen::CodeGenFunction::EmitSPIRVBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitSVEPredicateCast(), clang::CodeGen::CodeGenFunction::EmitSVEPredicateTupleCast(), clang::CodeGen::CodeGenFunction::EmitSVEPrefetchLoad(), clang::CodeGen::CodeGenFunction::EmitToMemory(), clang::CodeGen::CodeGenFunction::EmitWebAssemblyBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EmitX86CvtF16ToFloatExpr(), EmitX86FMAExpr(), EmitX86FunnelShift(), EmitX86MaskedCompareResult(), EmitX86ScalarSelect(), EmitX86Select(), EmitX86vpcom(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), clang::getDeclUsageType(), getMaskVecValue(), handleHlslSplitdouble(), isReferenceToNonConstCapture(), isUnsigned(), MakeAtomicCmpXchgValue(), clang::ast_matchers::matchEachArgumentWithParamTypeImpl(), clang::Sema::PerformMoveOrCopyInitialization(), print(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), Value(), and clang::interp::Compiler< Emitter >::visitSwitchStmt().
|
inline |
Definition at line 135 of file Value.h.
References isValid(), and isVoid().
Referenced by CheckEvaluationResult(), and HandleConstructorCall().
|
inline |
Definition at line 136 of file Value.h.
References IsManuallyAlloc.
|
inlineprotected |
|
inline |
Definition at line 133 of file Value.h.
References K_Unspecified, and ValueKind.
Referenced by hasValue(), and print().
|
inline |
Definition at line 134 of file Value.h.
References K_Void, and ValueKind.
Referenced by __clang_Interpreter_SetValueNoAlloc(), and hasValue().
Definition at line 185 of file Value.cpp.
References Data, getPtr(), Interp, IsManuallyAlloc, OpaqueType, Value(), and ValueKind.
Referenced by Value().
Definition at line 201 of file Value.cpp.
References Data, getPtr(), Interp, IsManuallyAlloc, K_Unspecified, OpaqueType, Value(), and ValueKind.
void clang::Value::print | ( | llvm::raw_ostream & | Out | ) | const |
Definition at line 262 of file Value.cpp.
References getType(), isValid(), OpaqueType, printData(), and printType().
Referenced by dump().
void clang::Value::printData | ( | llvm::raw_ostream & | Out | ) | const |
void clang::Value::printType | ( | llvm::raw_ostream & | Out | ) | const |
|
inline |
|
inline |
Definition at line 139 of file Value.h.
References OpaqueType.
|
inline |
Definition at line 142 of file Value.h.
References Data.
Referenced by __clang_Interpreter_SetValueNoAlloc(), and Value().
void clang::Value::setRawBits | ( | void * | Ptr, |
unsigned | NBits = sizeof(Storage) ) |
|
protected |
Definition at line 199 of file Value.h.
Referenced by as(), getPtr(), operator=(), operator=(), setPtr(), setRawBits(), Value(), and Value().
|
protected |
Definition at line 197 of file Value.h.
Referenced by clear(), getInterpreter(), operator=(), operator=(), printData(), printType(), Value(), Value(), and Value().
Definition at line 201 of file Value.h.
Referenced by clear(), isManuallyAlloc(), operator=(), operator=(), Value(), Value(), Value(), and clang::ValueRef::ValueRef().
|
protected |
Definition at line 198 of file Value.h.
Referenced by clear(), getType(), operator=(), operator=(), print(), setOpaqueType(), Value(), Value(), and Value().
|
protected |
Definition at line 200 of file Value.h.
Referenced by as(), clear(), getKind(), getPtr(), isPointerOrObjectType(), isValid(), isVoid(), operator=(), operator=(), setKind(), Value(), Value(), and Value().