clang 20.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 324 of file APValue.h.
Referenced by operator=().
|
inlineexplicit |
|
inlineexplicit |
Creates a float APValue holding the given value.
Definition at line 330 of file APValue.h.
References setFloat().
|
inlineexplicit |
Creates a vector APValue with N
elements.
The elements are read from E
.
Definition at line 339 of file APValue.h.
References E, and setVector().
|
inline |
Creates an integer complex APValue with the given real and imaginary values.
Definition at line 345 of file APValue.h.
References setComplexInt().
|
inline |
Creates a float complex APValue with the given real and imaginary values.
Definition at line 349 of file APValue.h.
References setComplexFloat().
APValue::APValue | ( | const APValue & | RHS | ) |
Definition at line 311 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, FixedPoint, Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFixedPoint(), getFloat(), getInt(), getKind(), getLValueBase(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorLength(), hasArrayFiller(), hasLValuePath(), Indeterminate, Int, isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, MemberPointer, None, setAddrLabelDiff(), setComplexFloat(), setComplexInt(), setFloat(), setInt(), setLValue(), setUnion(), setVector(), Struct, Union, and Vector.
APValue::APValue | ( | APValue && | RHS | ) |
Definition at line 383 of file APValue.cpp.
References None.
|
inline |
Creates an lvalue APValue without an lvalue path.
Base | The base of the lvalue. |
Offset | The offset of the lvalue. |
IsNullPtr | Whether this lvalue is a null pointer. |
Definition at line 358 of file APValue.h.
References setLValue().
|
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 371 of file APValue.h.
References Path, and setLValue().
|
inline |
Creates a constexpr unknown lvalue APValue.
Base | The base of the lvalue. |
Offset | The offset of the lvalue. |
IsNullPtr | Whether this lvalue is a null pointer. |
Definition at line 382 of file APValue.h.
References setLValue().
|
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. |
|
inlineexplicit |
Creates a new union APValue.
ActiveDecl | The FieldDecl of the active union member. |
ActiveValue | The value of the active union member. |
Definition at line 409 of file APValue.h.
References setUnion().
|
inline |
Creates a new member pointer APValue.
Member | Declaration of the member |
IsDerivedMember | Whether member is a derived one. |
Path | The path of the member. |
Definition at line 419 of file APValue.h.
References clang::Member, and Path.
|
inline |
Creates a new address label diff APValue.
LHSExpr | The left-hand side of the difference. |
RHSExpr | The right-hand side of the difference. |
Definition at line 427 of file APValue.h.
References setAddrLabelDiff().
|
inline |
Definition at line 440 of file APValue.h.
References Indeterminate, Kind, and None.
|
inline |
Definition at line 317 of file APValue.h.
Referenced by findSubobject(), and HandleLambdaCapture().
LLVM_DUMP_METHOD void APValue::dump | ( | ) | const |
Definition at line 337 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 342 of file ASTDumper.cpp.
References clang::ASTContext::CharTy, clang::ASTContext::getDiagnostics(), clang::ASTContext::getPointerType(), clang::DiagnosticsEngine::getShowColors(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Definition at line 644 of file APValue.h.
References Data, and isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 648 of file APValue.h.
References Data, and isAddrLabelDiff().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 586 of file APValue.h.
References Data, getArrayInitializedElts(), hasArrayFiller(), and isArray().
Referenced by APValue(), expandArray(), findSubobject(), getArrayFiller(), and Profile().
|
inline |
Definition at line 591 of file APValue.h.
References getArrayFiller().
Definition at line 575 of file APValue.h.
References Data, getArrayInitializedElts(), and isArray().
Referenced by APValue(), expandArray(), findSubobject(), getArrayInitializedElt(), clang::MSGuidDecl::getAsAPValue(), printPretty(), Profile(), clang::interp::Pointer::toRValue(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
Definition at line 580 of file APValue.h.
References getArrayInitializedElt().
|
inline |
Definition at line 594 of file APValue.h.
References Data, and isArray().
Referenced by APValue(), findSubobject(), getArrayFiller(), getArrayInitializedElt(), hasArrayFiller(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 598 of file APValue.h.
References Data, and isArray().
Referenced by APValue(), hasArrayFiller(), clang::ASTNodeImporter::ImportAPValue(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
std::string APValue::getAsString | ( | const ASTContext & | Ctx, |
QualType | Ty | ||
) | const |
Definition at line 957 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 542 of file APValue.h.
References Data, and isComplexFloat().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexFloatImag(), HandleConversionToBool(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 546 of file APValue.h.
References getComplexFloatImag().
|
inline |
Definition at line 534 of file APValue.h.
References Data, and isComplexFloat().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexFloatReal(), HandleConversionToBool(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 538 of file APValue.h.
References getComplexFloatReal().
|
inline |
Definition at line 526 of file APValue.h.
References Data, and isComplexInt().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexIntImag(), GetValueRange(), HandleConversionToBool(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 530 of file APValue.h.
References getComplexIntImag().
|
inline |
Definition at line 518 of file APValue.h.
References Data, and isComplexInt().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), getComplexIntReal(), GetValueRange(), HandleConversionToBool(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 522 of file APValue.h.
References getComplexIntReal().
|
inline |
Definition at line 510 of file APValue.h.
References Data, and isFixedPoint().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), EvaluateFixedPoint(), getFixedPoint(), HandleConversionToBool(), needsCleanup(), printPretty(), and Profile().
|
inline |
Definition at line 514 of file APValue.h.
References getFixedPoint().
|
inline |
Definition at line 502 of file APValue.h.
References Data, and isFloat().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), IsSameFloatAfterCast(), needsCleanup(), printPretty(), Profile(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::interp::Compiler< Emitter >::visitAPValue().
|
inline |
Definition at line 506 of file APValue.h.
References getFloat().
|
inline |
Definition at line 488 of file APValue.h.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), APValue(), clang::ast_matchers::AST_MATCHER(), clang::ast_matchers::libc_func_matchers::AST_MATCHER(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuiltinAlignment(), calculateConstraintSatisfaction(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), clang::Sema::CheckAdditionOperands(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), clang::Sema::checkCall(), checkFormatStringExpr(), clang::Sema::CheckLogicalOperands(), checkOpenMPLoop(), checkSimdlenSafelenSpecified(), clang::Sema::CheckSubtractionOperands(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), diagnoseWellFormedUnsatisfiedConstraintExpr(), EvaluateBuiltinStrLen(), clang::Expr::EvaluateCharRangeAsString(), EvaluateInteger(), clang::Sema::FillInlineAsmIdentifierInfo(), getInt(), clang::ConstantExpr::getResultAsAPSInt(), GetValueRange(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), needsCleanup(), clang::InitializationSequence::Perform(), printPretty(), Profile(), shouldAddCase(), toIntegralConstant(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::Sema::VerifyIntegerConstantExpression(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
|
inline |
|
inline |
Definition at line 460 of file APValue.h.
References Kind.
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), handleCompareOpForVector(), HandleConversionToBool(), handleLogicalOpForVector(), handleVectorUnaryOperator(), handleVectorVectorBinOp(), clang::ASTNodeImporter::ImportAPValue(), needsCleanup(), and printPretty().
const APValue::LValueBase APValue::getLValueBase | ( | ) | const |
Definition at line 984 of file APValue.cpp.
References isLValue().
Referenced by APValue(), EvaluateBuiltinConstantPForLValue(), getLValueType(), clang::ASTNodeImporter::ImportAPValue(), clang::interp::interp__builtin_constant_p(), clang::Expr::EvalResult::isGlobalLValue(), isNullPointerValueTemplateArgument(), printPretty(), Profile(), toIntegralConstant(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
unsigned APValue::getLValueCallIndex | ( | ) | const |
Definition at line 1010 of file APValue.cpp.
References isLValue().
CharUnits & APValue::getLValueOffset | ( | ) |
Definition at line 994 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), EvaluateBuiltinConstantPForLValue(), getLValueOffset(), clang::ASTNodeImporter::ImportAPValue(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_constant_p(), printPretty(), Profile(), and toIntegralConstant().
|
inline |
Definition at line 552 of file APValue.h.
References getLValueOffset().
ArrayRef< APValue::LValuePathEntry > APValue::getLValuePath | ( | ) | const |
Definition at line 1004 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 1015 of file APValue.cpp.
References isLValue().
const ValueDecl * APValue::getMemberPointerDecl | ( | ) | const |
Definition at line 1067 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 1081 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 611 of file APValue.h.
References Data, getStructNumBases(), and isStruct().
Referenced by APValue(), findSubobject(), getStructBase(), printPretty(), and Profile().
Definition at line 621 of file APValue.h.
References getStructBase().
Definition at line 616 of file APValue.h.
References Data, getStructNumBases(), getStructNumFields(), and isStruct().
Referenced by APValue(), findSubobject(), clang::MSGuidDecl::getAsAPValue(), getStructField(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
Definition at line 624 of file APValue.h.
References getStructField().
|
inline |
Definition at line 603 of file APValue.h.
References Data, and isStruct().
Referenced by APValue(), getStructBase(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 607 of file APValue.h.
References Data, and isStruct().
Referenced by APValue(), getStructField(), clang::ASTNodeImporter::ImportAPValue(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 628 of file APValue.h.
References Data, and isUnion().
Referenced by APValue(), findSubobject(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 632 of file APValue.h.
References Data, and isUnion().
Referenced by APValue(), findSubobject(), getUnionValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), Profile(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 636 of file APValue.h.
References getUnionValue().
Definition at line 562 of file APValue.h.
References Data, getVectorLength(), and isVector().
Referenced by BuildExpressionFromNonTypeTemplateArgumentValue(), findSubobject(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), IsSameFloatAfterCast(), printPretty(), and Profile().
Definition at line 567 of file APValue.h.
References getVectorElt().
|
inline |
Definition at line 570 of file APValue.h.
References Data, and isVector().
Referenced by APValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), GetValueRange(), getVectorElt(), handleVectorShuffle(), handleVectorVectorBinOp(), clang::ASTNodeImporter::ImportAPValue(), IsSameFloatAfterCast(), printPretty(), and Profile().
|
inline |
Definition at line 583 of file APValue.h.
References getArrayInitializedElts(), and getArraySize().
Referenced by APValue(), expandArray(), getArrayFiller(), and Profile().
bool APValue::hasLValuePath | ( | ) | const |
Definition at line 999 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), getLValuePath(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 464 of file APValue.h.
References Indeterminate, Kind, and None.
Referenced by CheckEvaluationResult(), clang::Sema::CheckForImmediateInvocation(), clang::Sema::ConstantFoldAttrArgs(), findSubobject(), getBuiltinAlignArguments(), and HandleLambdaCapture().
|
inlinestatic |
Definition at line 431 of file APValue.h.
References Indeterminate, and clang::Result.
Referenced by clang::ConstantExpr::getAPValueResult(), and handleDefaultInitValue().
|
inline |
Definition at line 462 of file APValue.h.
Referenced by clang::Sema::EvaluateConvertedConstantExpression(), findSubobject(), and clang::MSGuidDecl::getAsAPValue().
|
inline |
Definition at line 477 of file APValue.h.
References AddrLabelDiff, and Kind.
Referenced by getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), and GetValueRange().
|
inline |
Definition at line 473 of file APValue.h.
Referenced by getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 470 of file APValue.h.
References ComplexFloat, and Kind.
Referenced by findSubobject(), getComplexFloatImag(), getComplexFloatReal(), IsSameFloatAfterCast(), and setComplexFloat().
|
inline |
Definition at line 469 of file APValue.h.
References ComplexInt, and Kind.
Referenced by findSubobject(), getComplexIntImag(), getComplexIntReal(), GetValueRange(), and setComplexInt().
|
inline |
Definition at line 468 of file APValue.h.
References FixedPoint, and Kind.
Referenced by EvaluateFixedPoint(), getFixedPoint(), and setFixedPoint().
|
inline |
Definition at line 467 of file APValue.h.
Referenced by getFloat(), clang::StandardConversionSequence::getNarrowingKind(), IsSameFloatAfterCast(), setFloat(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 463 of file APValue.h.
References Indeterminate, and Kind.
Referenced by findSubobject(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 466 of file APValue.h.
Referenced by BuildConvertedConstantExpression(), calculateConstraintSatisfaction(), CheckEvalInICE(), EvaluateBuiltinStrLen(), clang::Sema::EvaluateConvertedConstantExpression(), EvaluateInteger(), getInt(), GetValueRange(), setInt(), shouldAddCase(), toIntegralConstant(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::Sema::VerifyIntegerConstantExpression(), clang::interp::Compiler< Emitter >::visitAPValue(), clang::interp::Compiler< Emitter >::visitAPValueInitializer(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
|
inline |
Definition at line 471 of file APValue.h.
Referenced by FastEvaluateAsRValue(), getLValueBase(), getLValueCallIndex(), getLValueOffset(), getLValuePath(), getLValueVersion(), GetValueRange(), handleVectorVectorBinOp(), hasLValuePath(), clang::interp::interp__builtin_constant_p(), clang::Expr::EvalResult::isGlobalLValue(), isLValueOnePastTheEnd(), isNullPointer(), isNullPointerValueTemplateArgument(), setLValue(), toIntegralConstant(), clang::interp::Compiler< Emitter >::visitAPValue(), clang::interp::Compiler< Emitter >::visitAPValueInitializer(), and clang::interp::Compiler< Emitter >::VisitSourceLocExpr().
bool APValue::isLValueOnePastTheEnd | ( | ) | const |
Definition at line 989 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().
|
inline |
Definition at line 476 of file APValue.h.
References Kind, and MemberPointer.
Referenced by getMemberPointerDecl(), getMemberPointerPath(), isMemberPointerToDerivedMember(), isNullPointerValueTemplateArgument(), clang::interp::Compiler< Emitter >::visitAPValue(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
bool APValue::isMemberPointerToDerivedMember | ( | ) | const |
Definition at line 1074 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), clang::ASTContext::getMemberPointerPathAdjustment(), clang::ASTNodeImporter::ImportAPValue(), and Profile().
bool APValue::isNullPointer | ( | ) | const |
Definition at line 1020 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 474 of file APValue.h.
Referenced by getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 475 of file APValue.h.
Referenced by getUnionField(), getUnionValue(), setUnion(), and clang::interp::Compiler< Emitter >::visitAPValueInitializer().
|
inline |
Definition at line 472 of file APValue.h.
Referenced by GetValueRange(), getVectorElt(), getVectorLength(), 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 438 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 397 of file APValue.cpp.
References 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 704 of file APValue.cpp.
References clang::ASTContext::getPrintingPolicy(), and printPretty().
Referenced by DiagTemplateArg(), getAsString(), clang::TemplateArgument::print(), clang::TemplateParamObjectDecl::printAsInit(), and printPretty().
void APValue::printPretty | ( | raw_ostream & | OS, |
const PrintingPolicy & | Policy, | ||
QualType | Ty, | ||
const ASTContext * | Ctx = nullptr |
||
) | const |
Definition at line 709 of file APValue.cpp.
References AddrLabelDiff, Array, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), ComplexFloat, ComplexInt, E, clang::PrintingPolicy::EntireContentsOfLargeArray, clang::RecordDecl::fields(), 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::ValueDecl::getType(), clang::CXXBaseSpecifier::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(), Path, 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 490 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, D, E, 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(), clang::Stmt::Profile(), profileIntValue(), Struct, Union, and Vector.
Referenced by Profile(), clang::TemplateArgument::Profile(), clang::UnnamedGlobalConstantDecl::Profile(), and clang::TemplateArgument::structurallyEquals().
|
inline |
|
inline |
Definition at line 677 of file APValue.h.
References Data, and isComplexFloat().
Referenced by APValue().
|
inline |
Definition at line 670 of file APValue.h.
References Data, and isComplexInt().
Referenced by APValue().
|
inline |
Definition at line 661 of file APValue.h.
References Data, and isFixedPoint().
|
inline |
|
inline |
void APValue::setLValue | ( | LValueBase | B, |
const CharUnits & | O, | ||
ArrayRef< LValuePathEntry > | Path, | ||
bool | OnePastTheEnd, | ||
bool | IsNullPtr | ||
) |
Definition at line 1049 of file APValue.cpp.
void APValue::setLValue | ( | LValueBase | B, |
const CharUnits & | O, | ||
NoLValuePath | , | ||
bool | IsNullPtr | ||
) |
Definition at line 1025 of file APValue.cpp.
References isLValue(), and clang::APValue::LV::resizePath().
Referenced by APValue().
Definition at line 1060 of file APValue.cpp.
References isUnion().
Referenced by APValue(), and findSubobject().
void APValue::swap | ( | APValue & | RHS | ) |
Swaps the contents of this and the given APValue.
Definition at line 475 of file APValue.cpp.
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 964 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 |
|
friend |