clang 22.0.0git
|
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset], [Vector: N * APValue], [Array: N * APValue]. More...
#include "clang/AST/APValue.h"
Classes | |
struct | ConstexprUnknown |
struct | LV |
class | LValueBase |
class | LValuePathEntry |
A non-discriminated union of a base, field, or array index. More... | |
class | LValuePathSerializationHelper |
struct | MemberPointerData |
struct | NoLValuePath |
struct | UninitArray |
struct | UninitStruct |
Public Types | |
enum | ValueKind { None , Indeterminate , Int , Float , FixedPoint , ComplexInt , ComplexFloat , LValue , Vector , Array , Struct , Union , MemberPointer , AddrLabelDiff } |
typedef llvm::PointerIntPair< const Decl *, 1, bool > | BaseOrMemberType |
A FieldDecl or CXXRecordDecl, along with a flag indicating whether we mean a virtual or non-virtual base class subobject. |
Public Member Functions | |
bool | allowConstexprUnknown () const |
void | setConstexprUnknown (bool IsConstexprUnknown=true) |
APValue () | |
Creates an empty APValue of type None. | |
APValue (APSInt I) | |
Creates an integer APValue holding the given value. | |
APValue (APFloat F) | |
Creates a float APValue holding the given value. | |
APValue (APFixedPoint FX) | |
Creates a fixed-point APValue holding the given value. | |
APValue (const APValue *E, unsigned N) | |
Creates a vector APValue with N elements. | |
APValue (APSInt R, APSInt I) | |
Creates an integer complex APValue with the given real and imaginary values. | |
APValue (APFloat R, APFloat I) | |
Creates a float complex APValue with the given real and imaginary values. | |
APValue (const APValue &RHS) | |
APValue (APValue &&RHS) | |
APValue (LValueBase Base, const CharUnits &Offset, NoLValuePath, bool IsNullPtr=false) | |
Creates an lvalue APValue without an lvalue path. | |
APValue (LValueBase Base, const CharUnits &Offset, ArrayRef< LValuePathEntry > Path, bool OnePastTheEnd, bool IsNullPtr=false) | |
Creates an lvalue APValue with an lvalue path. | |
APValue (LValueBase Base, const CharUnits &Offset, ConstexprUnknown, bool IsNullPtr=false) | |
Creates a constexpr unknown lvalue APValue. | |
APValue (UninitArray, unsigned InitElts, unsigned Size) | |
Creates a new array APValue. | |
APValue (UninitStruct, unsigned NumBases, unsigned NumMembers) | |
Creates a new struct APValue. | |
APValue (const FieldDecl *ActiveDecl, const APValue &ActiveValue=APValue()) | |
Creates a new union APValue. | |
APValue (const ValueDecl *Member, bool IsDerivedMember, ArrayRef< const CXXRecordDecl * > Path) | |
Creates a new member pointer APValue. | |
APValue (const AddrLabelExpr *LHSExpr, const AddrLabelExpr *RHSExpr) | |
Creates a new address label diff APValue. | |
APValue & | operator= (const APValue &RHS) |
APValue & | operator= (APValue &&RHS) |
~APValue () | |
bool | needsCleanup () const |
Returns whether the object performed allocations. | |
void | swap (APValue &RHS) |
Swaps the contents of this and the given APValue. | |
void | Profile (llvm::FoldingSetNodeID &ID) const |
profile this value. | |
ValueKind | getKind () const |
bool | isAbsent () const |
bool | isIndeterminate () const |
bool | hasValue () const |
bool | isInt () const |
bool | isFloat () const |
bool | isFixedPoint () const |
bool | isComplexInt () const |
bool | isComplexFloat () const |
bool | isLValue () const |
bool | isVector () const |
bool | isArray () const |
bool | isStruct () const |
bool | isUnion () const |
bool | isMemberPointer () const |
bool | isAddrLabelDiff () const |
void | dump () const |
void | dump (raw_ostream &OS, const ASTContext &Context) const |
void | printPretty (raw_ostream &OS, const ASTContext &Ctx, QualType Ty) const |
void | printPretty (raw_ostream &OS, const PrintingPolicy &Policy, QualType Ty, const ASTContext *Ctx=nullptr) const |
std::string | getAsString (const ASTContext &Ctx, QualType Ty) const |
APSInt & | getInt () |
const APSInt & | getInt () const |
bool | toIntegralConstant (APSInt &Result, QualType SrcTy, const ASTContext &Ctx) const |
Try to convert this value to an integral constant. | |
APFloat & | getFloat () |
const APFloat & | getFloat () const |
APFixedPoint & | getFixedPoint () |
const APFixedPoint & | getFixedPoint () const |
APSInt & | getComplexIntReal () |
const APSInt & | getComplexIntReal () const |
APSInt & | getComplexIntImag () |
const APSInt & | getComplexIntImag () const |
APFloat & | getComplexFloatReal () |
const APFloat & | getComplexFloatReal () const |
APFloat & | getComplexFloatImag () |
const APFloat & | getComplexFloatImag () const |
const LValueBase | getLValueBase () const |
CharUnits & | getLValueOffset () |
const CharUnits & | getLValueOffset () const |
bool | isLValueOnePastTheEnd () const |
bool | hasLValuePath () const |
ArrayRef< LValuePathEntry > | getLValuePath () const |
unsigned | getLValueCallIndex () const |
unsigned | getLValueVersion () const |
bool | isNullPointer () const |
APValue & | getVectorElt (unsigned I) |
const APValue & | getVectorElt (unsigned I) const |
unsigned | getVectorLength () const |
APValue & | getArrayInitializedElt (unsigned I) |
const APValue & | getArrayInitializedElt (unsigned I) const |
bool | hasArrayFiller () const |
APValue & | getArrayFiller () |
const APValue & | getArrayFiller () const |
unsigned | getArrayInitializedElts () const |
unsigned | getArraySize () const |
unsigned | getStructNumBases () const |
unsigned | getStructNumFields () const |
APValue & | getStructBase (unsigned i) |
APValue & | getStructField (unsigned i) |
const APValue & | getStructBase (unsigned i) const |
const APValue & | getStructField (unsigned i) const |
const FieldDecl * | getUnionField () const |
APValue & | getUnionValue () |
const APValue & | getUnionValue () const |
const ValueDecl * | getMemberPointerDecl () const |
bool | isMemberPointerToDerivedMember () const |
ArrayRef< const CXXRecordDecl * > | getMemberPointerPath () const |
const AddrLabelExpr * | getAddrLabelDiffLHS () const |
const AddrLabelExpr * | getAddrLabelDiffRHS () const |
void | setInt (APSInt I) |
void | setFloat (APFloat F) |
void | setFixedPoint (APFixedPoint FX) |
void | setVector (const APValue *E, unsigned N) |
void | setComplexInt (APSInt R, APSInt I) |
void | setComplexFloat (APFloat R, APFloat I) |
void | setLValue (LValueBase B, const CharUnits &O, NoLValuePath, bool IsNullPtr) |
void | setLValue (LValueBase B, const CharUnits &O, ArrayRef< LValuePathEntry > Path, bool OnePastTheEnd, bool IsNullPtr) |
void | setUnion (const FieldDecl *Field, const APValue &Value) |
void | setAddrLabelDiff (const AddrLabelExpr *LHSExpr, const AddrLabelExpr *RHSExpr) |
Static Public Member Functions | |
static APValue | IndeterminateValue () |
Friends | |
template<typename Impl> | |
class | clang::serialization::BasicReaderBase |
class | ASTImporter |
class | ASTNodeImporter |
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset], [Vector: N * APValue], [Array: N * APValue].
typedef llvm::PointerIntPair<const Decl *, 1, bool> clang::APValue::BaseOrMemberType |
A FieldDecl or CXXRecordDecl, along with a flag indicating whether we mean a virtual or non-virtual base class subobject.
|
inline |
Creates an empty APValue of type None.
Definition at line 325 of file APValue.h.
Referenced by APValue(), APValue(), APValue(), APValue(), getArrayFiller(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElt(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getLValueOffset(), getStructBase(), getStructBase(), getStructField(), getStructField(), getUnionValue(), getUnionValue(), getVectorElt(), getVectorElt(), IndeterminateValue(), operator=(), operator=(), setUnion(), setVector(), and swap().
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
APValue::APValue | ( | const APValue & | RHS | ) |
Definition at line 311 of file APValue.cpp.
References AddrLabelDiff, APValue(), Array, ComplexFloat, ComplexInt, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getKind(), getLValueBase(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorLength(), hasArrayFiller(), hasLValuePath(), isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, MemberPointer, None, setAddrLabelDiff(), setComplexFloat(), setComplexInt(), setLValue(), setUnion(), setVector(), Struct, Union, and Vector.
APValue::APValue | ( | APValue && | RHS | ) |
Definition at line 383 of file APValue.cpp.
|
inline |
|
inline |
Creates an lvalue APValue with an lvalue path.
Base | The base of the lvalue. |
Offset | The offset of the lvalue. |
Path | The lvalue path. |
OnePastTheEnd | Whether this lvalue is one-past-the-end of the subobject it points to. |
IsNullPtr | Whether this lvalue is a null pointer. |
Definition at line 372 of file APValue.h.
References false, None, and setLValue().
|
inline |
|
inline |
Creates a new array APValue.
UninitArray | Marker. Pass an empty UninitArray. |
InitElts | Number of elements you're going to initialize in the array. |
Size | Full size of the array. |
|
inline |
Creates a new struct APValue.
UninitStruct | Marker. Pass an empty UninitStruct. |
NumBases | Number of bases. |
NumMembers | Number of members. |
|
inline |
|
inline |
|
inline |
Definition at line 441 of file APValue.h.
References Indeterminate, and None.
|
inline |
Definition at line 318 of file APValue.h.
Referenced by HandleLambdaCapture().
LLVM_DUMP_METHOD void APValue::dump | ( | ) | const |
Definition at line 339 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
LLVM_DUMP_METHOD void APValue::dump | ( | raw_ostream & | OS, |
const ASTContext & | Context ) const |
Definition at line 344 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Definition at line 645 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 649 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 587 of file APValue.h.
References APValue(), getArrayInitializedElts(), hasArrayFiller(), and isArray().
Referenced by APValue(), expandArray(), findSubobject(), getArrayFiller(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 592 of file APValue.h.
References APValue(), and getArrayFiller().
Definition at line 576 of file APValue.h.
References APValue(), getArrayInitializedElts(), and isArray().
Referenced by APValue(), expandArray(), clang::GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(), findSubobject(), getArrayInitializedElt(), clang::MSGuidDecl::getAsAPValue(), printPretty(), Profile(), clang::interp::Pointer::toRValue(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
Definition at line 581 of file APValue.h.
References APValue(), and getArrayInitializedElt().
|
inline |
Definition at line 595 of file APValue.h.
References isArray().
Referenced by APValue(), findSubobject(), getArrayFiller(), getArrayInitializedElt(), hasArrayFiller(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 599 of file APValue.h.
References isArray().
Referenced by APValue(), clang::GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(), hasArrayFiller(), clang::ASTNodeImporter::ImportAPValue(), Profile(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
std::string APValue::getAsString | ( | const ASTContext & | Ctx, |
QualType | Ty ) const |
Definition at line 956 of file APValue.cpp.
References printPretty(), and clang::Result.
Referenced by BuildConvertedConstantExpression(), checkDynamicType(), checkThreeWayNarrowingConversion(), DiagnoseNarrowingInInitList(), findCompleteObject(), HandleDestructionImpl(), isNullPointerValueTemplateArgument(), clang::interp::FunctionPointer::toDiagnosticString(), clang::interp::MemberPointer::toDiagnosticString(), and clang::interp::Pointer::toDiagnosticString().
|
inline |
Definition at line 543 of file APValue.h.
References isComplexFloat().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexFloatImag(), HandleConversionToBool(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 547 of file APValue.h.
References APValue(), and getComplexFloatImag().
|
inline |
Definition at line 535 of file APValue.h.
References isComplexFloat().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexFloatReal(), HandleConversionToBool(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 539 of file APValue.h.
References APValue(), and getComplexFloatReal().
|
inline |
Definition at line 527 of file APValue.h.
References isComplexInt().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexIntImag(), GetValueRange(), HandleConversionToBool(), needsCleanup(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 531 of file APValue.h.
References APValue(), and getComplexIntImag().
|
inline |
Definition at line 519 of file APValue.h.
References isComplexInt().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexIntReal(), GetValueRange(), HandleConversionToBool(), needsCleanup(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 523 of file APValue.h.
References APValue(), and getComplexIntReal().
|
inline |
Definition at line 511 of file APValue.h.
References isFixedPoint().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), EvaluateFixedPoint(), getFixedPoint(), HandleConversionToBool(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 515 of file APValue.h.
References APValue(), and getFixedPoint().
|
inline |
Definition at line 503 of file APValue.h.
References isFloat().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), Profile(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 507 of file APValue.h.
References APValue(), and getFloat().
|
inline |
Definition at line 489 of file APValue.h.
References isInt().
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), clang::SemaOpenMP::ActOnOpenMPDeviceNum(), areEqualIntegers(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuiltinAlignment(), calculateConstraintSatisfaction(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), clang::Sema::CheckAdditionOperands(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::Sema::checkCall(), clang::SemaAMDGPU::checkCoopAtomicFunctionCall(), checkFormatStringExpr(), clang::Sema::CheckLogicalOperands(), checkOMPArraySectionConstantForReduction(), checkOpenMPLoop(), checkSimdlenSafelenSpecified(), clang::Sema::CheckSubtractionOperands(), CheckUnicodeArithmeticConversions(), clang::CIRGen::CIRGenFunction::constantFoldsToSimpleInteger(), ConvertBoolVectorToInt(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), diagnoseWellFormedUnsatisfiedConstraintExpr(), emitAtomicCmpXchgFailureSet(), clang::CIRGen::CIRGenFunction::emitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), EvaluateBuiltinStrLen(), EvaluateCharRangeAsStringImpl(), EvaluateInteger(), clang::Sema::FillInlineAsmIdentifierInfo(), getInt(), GetValueRange(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), isInLoop(), isPtrBufferSafe(), isSafeArraySubscript(), needsCleanup(), clang::InitializationSequence::Perform(), printPretty(), clang::processConstant32BitIntArgument(), Profile(), shouldAddCase(), toIntegralConstant(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::Sema::VerifyIntegerConstantExpression(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
|
inline |
|
inline |
Definition at line 461 of file APValue.h.
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), clang::ASTNodeImporter::ImportAPValue(), needsCleanup(), printPretty(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
const APValue::LValueBase APValue::getLValueBase | ( | ) | const |
Definition at line 983 of file APValue.cpp.
References isLValue().
Referenced by APValue(), EvaluateBuiltinConstantPForLValue(), findConstantBaseAndOffset(), getLValueType(), clang::ASTNodeImporter::ImportAPValue(), isNullPointerValueTemplateArgument(), printPretty(), Profile(), toIntegralConstant(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
unsigned APValue::getLValueCallIndex | ( | ) | const |
Definition at line 1009 of file APValue.cpp.
References isLValue().
CharUnits & APValue::getLValueOffset | ( | ) |
Definition at line 993 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), EvaluateBuiltinConstantPForLValue(), getLValueOffset(), clang::ASTNodeImporter::ImportAPValue(), clang::interp::interp__builtin_assume_aligned(), printPretty(), Profile(), and toIntegralConstant().
|
inline |
Definition at line 553 of file APValue.h.
References APValue(), and getLValueOffset().
ArrayRef< APValue::LValuePathEntry > APValue::getLValuePath | ( | ) | const |
Definition at line 1003 of file APValue.cpp.
References clang::APValue::LV::getPath(), hasLValuePath(), and isLValue().
Referenced by APValue(), getLValueType(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
unsigned APValue::getLValueVersion | ( | ) | const |
Definition at line 1014 of file APValue.cpp.
References isLValue().
const ValueDecl * APValue::getMemberPointerDecl | ( | ) | const |
Definition at line 1066 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), HandleConversionToBool(), clang::ASTNodeImporter::ImportAPValue(), isNullPointerValueTemplateArgument(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValue().
ArrayRef< const CXXRecordDecl * > APValue::getMemberPointerPath | ( | ) | const |
Definition at line 1080 of file APValue.cpp.
References clang::APValue::MemberPointerData::getPath(), and isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), clang::ASTNodeImporter::ImportAPValue(), and Profile().
Definition at line 612 of file APValue.h.
References APValue(), getStructNumBases(), and isStruct().
Referenced by APValue(), findSubobject(), getStructBase(), printPretty(), and Profile().
Definition at line 622 of file APValue.h.
References APValue(), and getStructBase().
Definition at line 617 of file APValue.h.
References APValue(), getStructNumBases(), getStructNumFields(), and isStruct().
Referenced by APValue(), findSubobject(), clang::MSGuidDecl::getAsAPValue(), getStructField(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
Definition at line 625 of file APValue.h.
References APValue(), and getStructField().
|
inline |
Definition at line 604 of file APValue.h.
References isStruct().
Referenced by APValue(), getStructBase(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 608 of file APValue.h.
References isStruct().
Referenced by APValue(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 629 of file APValue.h.
References isUnion().
Referenced by APValue(), findSubobject(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 633 of file APValue.h.
References APValue(), and isUnion().
Referenced by APValue(), findSubobject(), getUnionValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 637 of file APValue.h.
References APValue(), and getUnionValue().
Definition at line 563 of file APValue.h.
References APValue(), getVectorLength(), and isVector().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), ConvertBoolVectorToInt(), findSubobject(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), IsSameFloatAfterCast(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
Definition at line 568 of file APValue.h.
References APValue(), and getVectorElt().
|
inline |
Definition at line 571 of file APValue.h.
References isVector().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), ConvertBoolVectorToInt(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), clang::ASTNodeImporter::ImportAPValue(), IsSameFloatAfterCast(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 584 of file APValue.h.
References getArrayInitializedElts(), and getArraySize().
Referenced by APValue(), expandArray(), getArrayFiller(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
bool APValue::hasLValuePath | ( | ) | const |
Definition at line 998 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), getLValuePath(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 465 of file APValue.h.
References Indeterminate, and None.
Referenced by CheckEvaluationResult(), clang::Sema::CheckForImmediateInvocation(), getBuiltinAlignArguments(), HandleLambdaCapture(), and clang::Expr::isCXX11ConstantExpr().
|
inlinestatic |
Definition at line 432 of file APValue.h.
References APValue(), Indeterminate, and clang::Result.
Referenced by clang::ConstantExpr::getAPValueResult(), and handleDefaultInitValue().
|
inline |
Definition at line 463 of file APValue.h.
References None.
Referenced by clang::Sema::EvaluateConvertedConstantExpression(), and findSubobject().
|
inline |
Definition at line 478 of file APValue.h.
References AddrLabelDiff.
Referenced by getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), and GetValueRange().
|
inline |
Definition at line 474 of file APValue.h.
References Array.
Referenced by clang::GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 471 of file APValue.h.
References ComplexFloat.
Referenced by findSubobject(), getComplexFloatImag(), getComplexFloatReal(), IsSameFloatAfterCast(), and setComplexFloat().
|
inline |
Definition at line 470 of file APValue.h.
References ComplexInt.
Referenced by findSubobject(), getComplexIntImag(), getComplexIntReal(), GetValueRange(), and setComplexInt().
|
inline |
Definition at line 469 of file APValue.h.
References FixedPoint.
Referenced by EvaluateFixedPoint(), getFixedPoint(), and setFixedPoint().
|
inline |
Definition at line 468 of file APValue.h.
References Float.
Referenced by clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), IsSameFloatAfterCast(), setFloat(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 464 of file APValue.h.
References Indeterminate.
Referenced by findSubobject(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 467 of file APValue.h.
References Int.
Referenced by BuildConvertedConstantExpression(), calculateConstraintSatisfaction(), CheckEvalInICE(), ConvertBoolVectorToInt(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), EvaluateBuiltinStrLen(), clang::Sema::EvaluateConvertedConstantExpression(), EvaluateInteger(), getInt(), GetValueRange(), clang::processConstant32BitIntArgument(), setInt(), shouldAddCase(), toIntegralConstant(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::Sema::VerifyIntegerConstantExpression(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
|
inline |
Definition at line 472 of file APValue.h.
References LValue.
Referenced by EvaluateArgs(), FastEvaluateAsRValue(), getLValueBase(), getLValueCallIndex(), getLValueOffset(), getLValuePath(), getLValueVersion(), GetValueRange(), handleVectorVectorBinOp(), hasLValuePath(), isLValueOnePastTheEnd(), isNullPointer(), isNullPointerValueTemplateArgument(), setLValue(), toIntegralConstant(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
bool APValue::isLValueOnePastTheEnd | ( | ) | const |
Definition at line 988 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 477 of file APValue.h.
References MemberPointer.
Referenced by getMemberPointerDecl(), getMemberPointerPath(), isMemberPointerToDerivedMember(), isNullPointerValueTemplateArgument(), and clang::interp::Compiler< Emitter >::visitAPValue().
bool APValue::isMemberPointerToDerivedMember | ( | ) | const |
Definition at line 1073 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), clang::ASTNodeImporter::ImportAPValue(), and Profile().
bool APValue::isNullPointer | ( | ) | const |
Definition at line 1019 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), isNullPointerValueTemplateArgument(), clang::InitializationSequence::Perform(), printPretty(), Profile(), toIntegralConstant(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 475 of file APValue.h.
References Struct.
Referenced by getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 476 of file APValue.h.
References Union.
Referenced by getUnionField(), getUnionValue(), setUnion(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 473 of file APValue.h.
References Vector.
Referenced by ConvertBoolVectorToInt(), GetValueRange(), handleVectorVectorBinOp(), and IsSameFloatAfterCast().
bool APValue::needsCleanup | ( | ) | const |
Returns whether the object performed allocations.
If APValues are constructed via placement new, needsCleanup()
indicates whether the destructor must be called in order to correctly free all allocated memory.
Definition at line 437 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, FixedPoint, Float, getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getKind(), Indeterminate, Int, LValue, MemberPointer, needsCleanup(), None, Struct, Union, and Vector.
Referenced by needsCleanup(), and clang::ASTDeclReader::ReadVarDeclInit().
Definition at line 396 of file APValue.cpp.
References APValue(), Indeterminate, and None.
Definition at line 389 of file APValue.cpp.
References APValue().
void APValue::printPretty | ( | raw_ostream & | OS, |
const ASTContext & | Ctx, | ||
QualType | Ty ) const |
Definition at line 703 of file APValue.cpp.
References clang::ASTContext::getPrintingPolicy(), and printPretty().
Referenced by DiagTemplateArg(), getAsString(), clang::TemplateArgument::print(), clang::TemplateParamObjectDecl::printAsInit(), printPretty(), and printPretty().
void APValue::printPretty | ( | raw_ostream & | OS, |
const PrintingPolicy & | Policy, | ||
QualType | Ty, | ||
const ASTContext * | Ctx = nullptr ) const |
Definition at line 708 of file APValue.cpp.
References AddrLabelDiff, Array, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), clang::cast(), clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), clang::Type::castAsRecordDecl(), ComplexFloat, ComplexInt, clang::PrintingPolicy::EntireContentsOfLargeArray, clang::First, FixedPoint, Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), GetApproxValue(), getArrayInitializedElt(), getArrayInitializedElts(), clang::Type::getAs(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), clang::ArrayType::getElementType(), getFixedPoint(), getFloat(), getInt(), getKind(), clang::AddrLabelExpr::getLabel(), getLValueBase(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), clang::NamedDecl::getName(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), getStructBase(), getStructField(), getStructNumBases(), clang::CXXBaseSpecifier::getType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSizeInCharsIfKnown(), getUnionField(), getUnionValue(), getVectorElt(), getVectorLength(), hasLValuePath(), Indeterminate, Int, clang::Type::isAnyComplexType(), clang::Type::isBooleanType(), isLValueOnePastTheEnd(), clang::QualType::isNull(), isNullPointer(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::CharUnits::isZero(), LValue, MemberPointer, None, clang::PrintingPolicy::Nullptr, clang::CharUnits::One(), printPretty(), clang::Stmt::printPretty(), clang::QualType::stream(), Struct, TryPrintAsStringLiteral(), Union, Vector, and clang::CharUnits::Zero().
void APValue::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | const |
profile this value.
There is no guarantee that values of different types will not produce the same profiled value, so the type should typically also be profiled if it's not implied by the context.
Definition at line 489 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, FixedPoint, Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getCanonicalDecl(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getLValueBase(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorElt(), getVectorLength(), hasArrayFiller(), hasLValuePath(), Indeterminate, Int, isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, MemberPointer, None, clang::APValue::LValueBase::Profile(), Profile(), profileIntValue(), Struct, Union, and Vector.
Referenced by Profile(), clang::TemplateArgument::Profile(), clang::UnnamedGlobalConstantDecl::Profile(), and clang::TemplateArgument::structurallyEquals().
|
inline |
|
inline |
Definition at line 678 of file APValue.h.
References isComplexFloat().
Definition at line 671 of file APValue.h.
References isComplexInt().
|
inline |
Definition at line 662 of file APValue.h.
References isFixedPoint().
|
inline |
|
inline |
void APValue::setLValue | ( | LValueBase | B, |
const CharUnits & | O, | ||
ArrayRef< LValuePathEntry > | Path, | ||
bool | OnePastTheEnd, | ||
bool | IsNullPtr ) |
Definition at line 1048 of file APValue.cpp.
References memcpy().
void APValue::setLValue | ( | LValueBase | B, |
const CharUnits & | O, | ||
NoLValuePath | , | ||
bool | IsNullPtr ) |
Definition at line 1024 of file APValue.cpp.
References isLValue(), and clang::APValue::LV::resizePath().
Referenced by APValue(), APValue(), APValue(), and APValue().
Definition at line 1059 of file APValue.cpp.
References APValue(), and isUnion().
Referenced by APValue(), APValue(), and findSubobject().
void APValue::swap | ( | APValue & | RHS | ) |
Swaps the contents of this and the given APValue.
Definition at line 474 of file APValue.cpp.
References APValue().
Referenced by expandArray().
bool APValue::toIntegralConstant | ( | APSInt & | Result, |
QualType | SrcTy, | ||
const ASTContext & | Ctx ) const |
Try to convert this value to an integral constant.
This works if it's an integer, null pointer, or offset from a null pointer. Returns true on success.
Definition at line 963 of file APValue.cpp.
References getInt(), getLValueBase(), getLValueOffset(), clang::ASTContext::getTargetNullPointerValue(), isInt(), isLValue(), isNullPointer(), clang::ASTContext::MakeIntValue(), and clang::Result.
Referenced by clang::Sema::ActOnGCCAsmStmt().
|
friend |
|
friend |
Definition at line 255 of file APValue.h.
References ASTNodeImporter.
Referenced by ASTNodeImporter.
|
friend |