|
clang 23.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 , Matrix , 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 (const APValue *E, unsigned NumRows, unsigned NumCols) | |
| Creates a matrix APValue with given dimensions. | |
| 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 | isMatrix () 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 |
| unsigned | getMatrixNumRows () const |
| unsigned | getMatrixNumColumns () const |
| unsigned | getMatrixNumElements () const |
| APValue & | getMatrixElt (unsigned Idx) |
| const APValue & | getMatrixElt (unsigned Idx) const |
| APValue & | getMatrixElt (unsigned Row, unsigned Col) |
| const APValue & | getMatrixElt (unsigned Row, unsigned Col) 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 | setMatrix (const APValue *E, unsigned NumRows, unsigned NumCols) |
| 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 336 of file APValue.h.
Referenced by APValue(), APValue(), APValue(), APValue(), APValue(), getArrayFiller(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElt(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getLValueOffset(), getMatrixElt(), getMatrixElt(), getMatrixElt(), getMatrixElt(), getStructBase(), getStructBase(), getStructField(), getStructField(), getUnionValue(), getUnionValue(), getVectorElt(), getVectorElt(), IndeterminateValue(), operator=(), operator=(), setMatrix(), 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(), getMatrixNumColumns(), getMatrixNumRows(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorLength(), hasArrayFiller(), hasLValuePath(), isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, Matrix, MemberPointer, None, setAddrLabelDiff(), setComplexFloat(), setComplexInt(), setLValue(), setMatrix(), setUnion(), setVector(), Struct, Union, and Vector.
| APValue::APValue | ( | APValue && | RHS | ) |
Definition at line 388 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 390 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 459 of file APValue.h.
References Indeterminate, and None.
|
inline |
Definition at line 329 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 695 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 699 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 637 of file APValue.h.
References APValue(), getArrayInitializedElts(), hasArrayFiller(), and isArray().
Referenced by APValue(), buildConstantDataArrayFromElements(), expandArray(), findSubobject(), getArrayFiller(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 642 of file APValue.h.
References APValue(), and getArrayFiller().
Definition at line 626 of file APValue.h.
References APValue(), getArrayInitializedElts(), and isArray().
Referenced by APValue(), buildConstantDataArrayFromElements(), expandArray(), clang::GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(), findSubobject(), getArrayInitializedElt(), clang::MSGuidDecl::getAsAPValue(), printPretty(), Profile(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
Definition at line 631 of file APValue.h.
References APValue(), and getArrayInitializedElt().
|
inline |
Definition at line 645 of file APValue.h.
References isArray().
Referenced by APValue(), buildConstantDataArrayFromElements(), findSubobject(), getArrayFiller(), getArrayInitializedElt(), hasArrayFiller(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 649 of file APValue.h.
References isArray().
Referenced by APValue(), buildConstantDataArrayFromElements(), 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 988 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 562 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 566 of file APValue.h.
References APValue(), and getComplexFloatImag().
|
inline |
Definition at line 554 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 558 of file APValue.h.
References APValue(), and getComplexFloatReal().
|
inline |
Definition at line 546 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 550 of file APValue.h.
References APValue(), and getComplexIntImag().
|
inline |
Definition at line 538 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 542 of file APValue.h.
References APValue(), and getComplexIntReal().
|
inline |
Definition at line 530 of file APValue.h.
References isFixedPoint().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), EvaluateFixedPoint(), getFixedPoint(), HandleConversionToBool(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 534 of file APValue.h.
References APValue(), and getFixedPoint().
|
inline |
Definition at line 522 of file APValue.h.
References isFloat().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleScalarCast(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), Profile(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 526 of file APValue.h.
References APValue(), and getFloat().
|
inline |
Definition at line 508 of file APValue.h.
References isInt().
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), clang::SemaOpenMP::ActOnOpenMPDeviceNum(), areEqualIntegers(), buildConstantDataArrayFromElements(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuiltinAlignment(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), clang::Sema::CheckAdditionOperands(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::SemaAMDGPU::checkAtomicOrderingCABIArg(), clang::Sema::checkCall(), checkFormatStringExpr(), clang::Sema::CheckLogicalOperands(), checkOMPArraySectionConstantForReduction(), checkOpenMPLoop(), checkSimdlenSafelenSpecified(), clang::Sema::CheckSubtractionOperands(), CheckUnicodeArithmeticConversions(), clang::CIRGen::CIRGenFunction::constantFoldsToSimpleInteger(), ConvertBoolVectorToInt(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), diagnoseWellFormedUnsatisfiedConstraintExpr(), clang::CIRGen::CIRGenFunction::emitAsmInput(), emitAtomicCmpXchgFailureSet(), clang::CIRGen::CIRGenFunction::emitAtomicExprWithMemOrder(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), evalPackBuiltin(), evalShiftWithCount(), 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 479 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 1015 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 1041 of file APValue.cpp.
References isLValue().
| CharUnits & APValue::getLValueOffset | ( | ) |
Definition at line 1025 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 572 of file APValue.h.
References APValue(), and getLValueOffset().
| ArrayRef< APValue::LValuePathEntry > APValue::getLValuePath | ( | ) | const |
Definition at line 1035 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 1046 of file APValue.cpp.
References isLValue().
Definition at line 606 of file APValue.h.
References APValue(), getMatrixNumElements(), and isMatrix().
Referenced by getMatrixElt(), getMatrixElt(), getMatrixElt(), hlslAggSplatHelper(), IsSameFloatAfterCast(), printPretty(), and Profile().
Definition at line 611 of file APValue.h.
References APValue(), and getMatrixElt().
Definition at line 614 of file APValue.h.
References APValue(), getMatrixElt(), getMatrixNumColumns(), getMatrixNumRows(), and isMatrix().
Definition at line 622 of file APValue.h.
References APValue(), and getMatrixElt().
|
inline |
Definition at line 599 of file APValue.h.
References isMatrix().
Referenced by APValue(), getMatrixElt(), getMatrixNumElements(), printPretty(), and Profile().
|
inline |
Definition at line 603 of file APValue.h.
References getMatrixNumColumns(), and getMatrixNumRows().
Referenced by getMatrixElt(), and IsSameFloatAfterCast().
|
inline |
Definition at line 595 of file APValue.h.
References isMatrix().
Referenced by APValue(), getMatrixElt(), getMatrixNumElements(), printPretty(), and Profile().
| const ValueDecl * APValue::getMemberPointerDecl | ( | ) | const |
Definition at line 1098 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), HandleConversionToBool(), clang::ASTNodeImporter::ImportAPValue(), isNullPointerValueTemplateArgument(), printPretty(), Profile(), clang::CIRGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
| ArrayRef< const CXXRecordDecl * > APValue::getMemberPointerPath | ( | ) | const |
Definition at line 1112 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 662 of file APValue.h.
References APValue(), getStructNumBases(), and isStruct().
Referenced by APValue(), findSubobject(), getStructBase(), printPretty(), and Profile().
Definition at line 672 of file APValue.h.
References APValue(), and getStructBase().
Definition at line 667 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 675 of file APValue.h.
References APValue(), and getStructField().
|
inline |
Definition at line 654 of file APValue.h.
References isStruct().
Referenced by APValue(), getStructBase(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 658 of file APValue.h.
References isStruct().
Referenced by APValue(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 679 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 683 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 687 of file APValue.h.
References APValue(), and getUnionValue().
Definition at line 582 of file APValue.h.
References APValue(), getVectorLength(), and isVector().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), ConvertBoolVectorToInt(), evalPackBuiltin(), evalShiftWithCount(), evalShuffleGeneric(), findSubobject(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), hlslAggSplatHelper(), IsSameFloatAfterCast(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
Definition at line 587 of file APValue.h.
References APValue(), and getVectorElt().
|
inline |
Definition at line 590 of file APValue.h.
References isVector().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), ConvertBoolVectorToInt(), evalPackBuiltin(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), hlslAggSplatHelper(), clang::ASTNodeImporter::ImportAPValue(), IsSameFloatAfterCast(), printPretty(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 634 of file APValue.h.
References getArrayInitializedElts(), and getArraySize().
Referenced by APValue(), buildConstantDataArrayFromElements(), expandArray(), getArrayFiller(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
| bool APValue::hasLValuePath | ( | ) | const |
Definition at line 1030 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), getLValuePath(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 483 of file APValue.h.
References Indeterminate, and None.
Referenced by CheckEvaluationResult(), clang::Sema::CheckForImmediateInvocation(), getBuiltinAlignArguments(), HandleLambdaCapture(), and clang::Expr::isCXX11ConstantExpr().
|
inlinestatic |
Definition at line 450 of file APValue.h.
References APValue(), Indeterminate, and clang::Result.
Referenced by expandVector(), clang::ConstantExpr::getAPValueResult(), and handleDefaultInitValue().
|
inline |
Definition at line 481 of file APValue.h.
References None.
Referenced by clang::Sema::EvaluateConvertedConstantExpression(), and findSubobject().
|
inline |
Definition at line 497 of file APValue.h.
References AddrLabelDiff.
Referenced by getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), and GetValueRange().
|
inline |
Definition at line 493 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 489 of file APValue.h.
References ComplexFloat.
Referenced by findSubobject(), getComplexFloatImag(), getComplexFloatReal(), IsSameFloatAfterCast(), and setComplexFloat().
|
inline |
Definition at line 488 of file APValue.h.
References ComplexInt.
Referenced by findSubobject(), getComplexIntImag(), getComplexIntReal(), GetValueRange(), and setComplexInt().
|
inline |
Definition at line 487 of file APValue.h.
References FixedPoint.
Referenced by EvaluateFixedPoint(), getFixedPoint(), and setFixedPoint().
|
inline |
Definition at line 486 of file APValue.h.
References Float.
Referenced by clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), hlslAggSplatHelper(), IsSameFloatAfterCast(), setFloat(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 482 of file APValue.h.
References Indeterminate.
Referenced by expandVector(), findSubobject(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 485 of file APValue.h.
References Int.
Referenced by BuildConvertedConstantExpression(), CheckEvalInICE(), ConvertBoolVectorToInt(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), EvaluateBuiltinStrLen(), clang::Sema::EvaluateConvertedConstantExpression(), EvaluateInteger(), getInt(), GetValueRange(), hlslAggSplatHelper(), 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 490 of file APValue.h.
References LValue.
Referenced by EvaluateArgs(), FastEvaluateAsRValue(), getLValueBase(), getLValueCallIndex(), getLValueOffset(), getLValuePath(), getLValueVersion(), GetValueRange(), handleVectorVectorBinOp(), hasLValuePath(), hlslElementwiseCastHelper(), isLValueOnePastTheEnd(), isNullPointer(), isNullPointerValueTemplateArgument(), clang::InitializationSequence::Perform(), setLValue(), toIntegralConstant(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
| bool APValue::isLValueOnePastTheEnd | ( | ) | const |
Definition at line 1020 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 492 of file APValue.h.
References Matrix.
Referenced by getMatrixElt(), getMatrixElt(), getMatrixNumColumns(), getMatrixNumRows(), hlslAggSplatHelper(), and IsSameFloatAfterCast().
|
inline |
Definition at line 496 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 1105 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), clang::ASTNodeImporter::ImportAPValue(), Profile(), and clang::CIRGen::ConstantEmitter::tryEmitPrivate().
| bool APValue::isNullPointer | ( | ) | const |
Definition at line 1051 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 494 of file APValue.h.
References Struct.
Referenced by getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 495 of file APValue.h.
References Union.
Referenced by getUnionField(), getUnionValue(), setUnion(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 491 of file APValue.h.
References Vector.
Referenced by ConvertBoolVectorToInt(), findSubobject(), GetValueRange(), handleVectorVectorBinOp(), hlslAggSplatHelper(), 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 444 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, FixedPoint, Float, getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getKind(), Indeterminate, Int, LValue, Matrix, MemberPointer, needsCleanup(), None, Struct, Union, and Vector.
Referenced by needsCleanup(), and clang::ASTDeclReader::ReadVarDeclInit().
Definition at line 401 of file APValue.cpp.
References APValue(), Indeterminate, and None.
Definition at line 394 of file APValue.cpp.
References APValue().
| void APValue::printPretty | ( | raw_ostream & | OS, |
| const ASTContext & | Ctx, | ||
| QualType | Ty ) const |
Definition at line 717 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 722 of file APValue.cpp.
References AddrLabelDiff, Array, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), clang::C, 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(), getMatrixElt(), getMatrixNumColumns(), getMatrixNumRows(), 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::CharUnits::isMultipleOf(), clang::QualType::isNull(), isNullPointer(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::CharUnits::isZero(), LValue, Matrix, 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 497 of file APValue.cpp.
References AddrLabelDiff, Array, clang::C, ComplexFloat, ComplexInt, FixedPoint, Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getCanonicalDecl(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getLValueBase(), getLValueOffset(), getLValuePath(), getMatrixElt(), getMatrixNumColumns(), getMatrixNumRows(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorElt(), getVectorLength(), hasArrayFiller(), hasLValuePath(), Indeterminate, Int, isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, Matrix, 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 733 of file APValue.h.
References isComplexFloat().
Definition at line 726 of file APValue.h.
References isComplexInt().
|
inline |
Definition at line 712 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 1080 of file APValue.cpp.
References memcpy().
| void APValue::setLValue | ( | LValueBase | B, |
| const CharUnits & | O, | ||
| NoLValuePath | , | ||
| bool | IsNullPtr ) |
Definition at line 1056 of file APValue.cpp.
References isLValue(), and clang::APValue::LV::resizePath().
Referenced by APValue(), APValue(), APValue(), and APValue().
Definition at line 1091 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 482 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 995 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(), and clang::CIRGen::CIRGenFunction::emitAsmInput().
|
friend |
|
friend |
Definition at line 256 of file APValue.h.
References ASTNodeImporter.
Referenced by ASTNodeImporter.
|
friend |