clang 24.0.0git
clang::APValue Class Reference

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 , Reflection
}
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, CharUnits Offset, NoLValuePath, bool IsNullPtr=false)
 Creates an lvalue APValue without an lvalue path.
 APValue (LValueBase Base, CharUnits Offset, ArrayRef< LValuePathEntry > Path, bool OnePastTheEnd, bool IsNullPtr=false)
 Creates an lvalue APValue with an lvalue path.
 APValue (LValueBase Base, CharUnits Offset, ConstexprUnknown, bool IsNullPtr=false)
 Creates a constexpr unknown lvalue APValue.
 APValue (UninitArray, unsigned InitElts, unsigned Size)
 Creates a new array APValue.
 APValue (ReflectionKind OperandKind, const void *Operand)
 Creates a new Reflection APValue.
 APValue (UninitStruct, unsigned NumBases, unsigned NumMembers, unsigned NumVirtualBases=0)
 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
void visit (llvm::function_ref< bool(const APValue &)> Visitor) const
 Visit this value and every recursively nested value.
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
bool isReflection () 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 ()
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
unsigned getStructNumVirtualBases () const
APValue & getStructBase (unsigned i)
APValue & getStructField (unsigned i)
APValue & getStructVirtualBase (unsigned i)
const APValue & getStructBase (unsigned i) const
const APValue & getStructField (unsigned i) const
const APValue & getStructVirtualBase (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
ReflectionKind getReflectionOperandKind () const
const void * getReflectionOpaqueOperand () 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, CharUnits O, NoLValuePath, bool IsNullPtr)
void setLValue (LValueBase B, 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

Detailed Description

APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset], [Vector: N * APValue], [Array: N * APValue].

Definition at line 158 of file APValue.h.

Member Typedef Documentation

◆ BaseOrMemberType

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.

Definition at line 242 of file APValue.h.

Member Enumeration Documentation

◆ ValueKind

Enumerator
None 

There is no such object (it's outside its lifetime).

Indeterminate 

This object has an indeterminate value (C++ [basic.indet]).

Int 
Float 
FixedPoint 
ComplexInt 
ComplexFloat 
LValue 
Vector 
Matrix 
Array 
Struct 
Union 
MemberPointer 
AddrLabelDiff 
Reflection 

Definition at line 163 of file APValue.h.

Constructor & Destructor Documentation

◆ APValue() [1/19]

◆ APValue() [2/19]

clang::APValue::APValue ( APSInt I)
inlineexplicit

Creates an integer APValue holding the given value.

Definition at line 387 of file APValue.h.

References false, and None.

◆ APValue() [3/19]

clang::APValue::APValue ( APFloat F)
inlineexplicit

Creates a float APValue holding the given value.

Definition at line 391 of file APValue.h.

References false, and None.

◆ APValue() [4/19]

clang::APValue::APValue ( APFixedPoint FX)
inlineexplicit

Creates a fixed-point APValue holding the given value.

Definition at line 395 of file APValue.h.

References false, and None.

◆ APValue() [5/19]

clang::APValue::APValue ( const APValue * E,
unsigned N )
inlineexplicit

Creates a vector APValue with N elements.

The elements are read from E.

Definition at line 400 of file APValue.h.

References APValue(), false, None, and setVector().

◆ APValue() [6/19]

clang::APValue::APValue ( const APValue * E,
unsigned NumRows,
unsigned NumCols )
inlineexplicit

Creates a matrix APValue with given dimensions.

The elements are read from E and assumed to be in row-major order.

Definition at line 406 of file APValue.h.

References APValue(), false, None, and setMatrix().

◆ APValue() [7/19]

clang::APValue::APValue ( APSInt R,
APSInt I )
inline

Creates an integer complex APValue with the given real and imaginary values.

Definition at line 413 of file APValue.h.

References false, None, and setComplexInt().

◆ APValue() [8/19]

clang::APValue::APValue ( APFloat R,
APFloat I )
inline

Creates a float complex APValue with the given real and imaginary values.

Definition at line 417 of file APValue.h.

References false, None, and setComplexFloat().

◆ APValue() [9/19]

◆ APValue() [10/19]

APValue::APValue ( APValue && RHS)

Definition at line 442 of file APValue.cpp.

References APValue(), and None.

◆ APValue() [11/19]

clang::APValue::APValue ( LValueBase Base,
CharUnits Offset,
NoLValuePath ,
bool IsNullPtr = false )
inline

Creates an lvalue APValue without an lvalue path.

Parameters
BaseThe base of the lvalue.
OffsetThe offset of the lvalue.
IsNullPtrWhether this lvalue is a null pointer.

Definition at line 426 of file APValue.h.

References false, None, and setLValue().

◆ APValue() [12/19]

clang::APValue::APValue ( LValueBase Base,
CharUnits Offset,
ArrayRef< LValuePathEntry > Path,
bool OnePastTheEnd,
bool IsNullPtr = false )
inline

Creates an lvalue APValue with an lvalue path.

Parameters
BaseThe base of the lvalue.
OffsetThe offset of the lvalue.
PathThe lvalue path.
OnePastTheEndWhether this lvalue is one-past-the-end of the subobject it points to.
IsNullPtrWhether this lvalue is a null pointer.

Definition at line 439 of file APValue.h.

References false, None, and setLValue().

◆ APValue() [13/19]

clang::APValue::APValue ( LValueBase Base,
CharUnits Offset,
ConstexprUnknown ,
bool IsNullPtr = false )
inline

Creates a constexpr unknown lvalue APValue.

Parameters
BaseThe base of the lvalue.
OffsetThe offset of the lvalue.
IsNullPtrWhether this lvalue is a null pointer.

Definition at line 449 of file APValue.h.

References None, setLValue(), and true.

◆ APValue() [14/19]

clang::APValue::APValue ( UninitArray ,
unsigned InitElts,
unsigned Size )
inline

Creates a new array APValue.

Parameters
UninitArrayMarker. Pass an empty UninitArray.
InitEltsNumber of elements you're going to initialize in the array.
SizeFull size of the array.

Definition at line 461 of file APValue.h.

References false, and None.

◆ APValue() [15/19]

clang::APValue::APValue ( ReflectionKind OperandKind,
const void * Operand )
inline

Creates a new Reflection APValue.

Parameters
OperandKindThe kind of reflection.
OperandThe entity being reflected.

Definition at line 469 of file APValue.h.

References None.

◆ APValue() [16/19]

clang::APValue::APValue ( UninitStruct ,
unsigned NumBases,
unsigned NumMembers,
unsigned NumVirtualBases = 0 )
inline

Creates a new struct APValue.

Parameters
UninitStructMarker. Pass an empty UninitStruct.
NumBasesNumber of bases.
NumMembersNumber of members.
NumVirtualBasesNumber of virtual bases.

Definition at line 478 of file APValue.h.

References false, and None.

◆ APValue() [17/19]

clang::APValue::APValue ( const FieldDecl * ActiveDecl,
const APValue & ActiveValue = APValue() )
inlineexplicit

Creates a new union APValue.

Parameters
ActiveDeclThe FieldDecl of the active union member.
ActiveValueThe value of the active union member.

Definition at line 486 of file APValue.h.

References APValue(), false, None, and setUnion().

◆ APValue() [18/19]

clang::APValue::APValue ( const ValueDecl * Member,
bool IsDerivedMember,
ArrayRef< const CXXRecordDecl * > Path )
inline

Creates a new member pointer APValue.

Parameters
MemberDeclaration of the member
IsDerivedMemberWhether member is a derived one.
PathThe path of the member.

Definition at line 496 of file APValue.h.

References false, clang::Member, and None.

◆ APValue() [19/19]

clang::APValue::APValue ( const AddrLabelExpr * LHSExpr,
const AddrLabelExpr * RHSExpr )
inline

Creates a new address label diff APValue.

Parameters
LHSExprThe left-hand side of the difference.
RHSExprThe right-hand side of the difference.

Definition at line 504 of file APValue.h.

References false, None, and setAddrLabelDiff().

◆ ~APValue()

clang::APValue::~APValue ( )
inline

Definition at line 517 of file APValue.h.

References Indeterminate, and None.

Member Function Documentation

◆ allowConstexprUnknown()

bool clang::APValue::allowConstexprUnknown ( ) const
inline

Definition at line 378 of file APValue.h.

Referenced by HandleLambdaCapture().

◆ dump() [1/2]

LLVM_DUMP_METHOD void APValue::dump ( ) const

◆ dump() [2/2]

LLVM_DUMP_METHOD void APValue::dump ( raw_ostream & OS,
const ASTContext & Context ) const

◆ getAddrLabelDiffLHS()

const AddrLabelExpr * clang::APValue::getAddrLabelDiffLHS ( ) const
inline

◆ getAddrLabelDiffRHS()

const AddrLabelExpr * clang::APValue::getAddrLabelDiffRHS ( ) const
inline

◆ getArrayFiller() [1/2]

◆ getArrayFiller() [2/2]

const APValue & clang::APValue::getArrayFiller ( ) const
inline

Definition at line 707 of file APValue.h.

References APValue(), and getArrayFiller().

◆ getArrayInitializedElt() [1/2]

◆ getArrayInitializedElt() [2/2]

const APValue & clang::APValue::getArrayInitializedElt ( unsigned I) const
inline

Definition at line 696 of file APValue.h.

References APValue(), and getArrayInitializedElt().

◆ getArrayInitializedElts()

◆ getArraySize()

◆ getAsString()

◆ getComplexFloatImag() [1/2]

◆ getComplexFloatImag() [2/2]

const APFloat & clang::APValue::getComplexFloatImag ( ) const
inline

Definition at line 631 of file APValue.h.

References APValue(), and getComplexFloatImag().

◆ getComplexFloatReal() [1/2]

◆ getComplexFloatReal() [2/2]

const APFloat & clang::APValue::getComplexFloatReal ( ) const
inline

Definition at line 623 of file APValue.h.

References APValue(), and getComplexFloatReal().

◆ getComplexIntImag() [1/2]

◆ getComplexIntImag() [2/2]

const APSInt & clang::APValue::getComplexIntImag ( ) const
inline

Definition at line 615 of file APValue.h.

References APValue(), and getComplexIntImag().

◆ getComplexIntReal() [1/2]

◆ getComplexIntReal() [2/2]

const APSInt & clang::APValue::getComplexIntReal ( ) const
inline

Definition at line 607 of file APValue.h.

References APValue(), and getComplexIntReal().

◆ getFixedPoint() [1/2]

◆ getFixedPoint() [2/2]

const APFixedPoint & clang::APValue::getFixedPoint ( ) const
inline

Definition at line 599 of file APValue.h.

References APValue(), and getFixedPoint().

◆ getFloat() [1/2]

◆ getFloat() [2/2]

const APFloat & clang::APValue::getFloat ( ) const
inline

Definition at line 591 of file APValue.h.

References APValue(), and getFloat().

◆ getInt() [1/2]

APSInt & clang::APValue::getInt ( )
inline

Definition at line 573 of file APValue.h.

References isInt().

Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), clang::SemaOpenMP::ActOnOpenMPDeviceNum(), clang::SemaOpenMP::ActOnOpenMPFlattenDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), areEqualIntegers(), buildConstantDataArrayFromElements(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuiltinAlignment(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), clang::Sema::CheckAdditionOperands(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), clang::SemaAMDGPU::checkAtomicOrderingCABIArg(), clang::SemaOpenCL::checkBuiltinReadImage(), clang::Sema::checkCall(), checkFormatStringExpr(), clang::Sema::CheckLogicalOperands(), checkOpenMPLoop(), checkSimdlenSafelenSpecified(), clang::Sema::CheckSubtractionOperands(), CheckUnicodeArithmeticConversions(), clang::Sema::ComputeExpansionSize(), 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(), isPtrBufferSafe(), isSafeArraySubscript(), isSafePointerArithmetic(), 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(), clang::interp::Compiler< Emitter >::VisitSourceLocExpr(), and clang::interp::Compiler< Emitter >::VisitTypeTraitExpr().

◆ getInt() [2/2]

const APSInt & clang::APValue::getInt ( ) const
inline

Definition at line 577 of file APValue.h.

References APValue(), and getInt().

◆ getKind()

◆ getLValueBase()

◆ getLValueCallIndex()

unsigned APValue::getLValueCallIndex ( ) const

Definition at line 1152 of file APValue.cpp.

References isLValue().

◆ getLValueOffset() [1/2]

◆ getLValueOffset() [2/2]

CharUnits clang::APValue::getLValueOffset ( ) const
inline

Definition at line 637 of file APValue.h.

References APValue(), and getLValueOffset().

◆ getLValuePath()

◆ getLValueVersion()

unsigned APValue::getLValueVersion ( ) const

Definition at line 1157 of file APValue.cpp.

References isLValue().

◆ getMatrixElt() [1/4]

APValue & clang::APValue::getMatrixElt ( unsigned Idx)
inline

◆ getMatrixElt() [2/4]

const APValue & clang::APValue::getMatrixElt ( unsigned Idx) const
inline

Definition at line 676 of file APValue.h.

References APValue(), and getMatrixElt().

◆ getMatrixElt() [3/4]

APValue & clang::APValue::getMatrixElt ( unsigned Row,
unsigned Col )
inline

Definition at line 679 of file APValue.h.

References APValue(), getMatrixElt(), getMatrixNumColumns(), getMatrixNumRows(), and isMatrix().

◆ getMatrixElt() [4/4]

const APValue & clang::APValue::getMatrixElt ( unsigned Row,
unsigned Col ) const
inline

Definition at line 687 of file APValue.h.

References APValue(), and getMatrixElt().

◆ getMatrixNumColumns()

unsigned clang::APValue::getMatrixNumColumns ( ) const
inline

Definition at line 664 of file APValue.h.

References isMatrix().

Referenced by APValue(), getMatrixElt(), getMatrixNumElements(), printPretty(), and Profile().

◆ getMatrixNumElements()

unsigned clang::APValue::getMatrixNumElements ( ) const
inline

Definition at line 668 of file APValue.h.

References getMatrixNumColumns(), and getMatrixNumRows().

Referenced by getMatrixElt(), and IsSameFloatAfterCast().

◆ getMatrixNumRows()

unsigned clang::APValue::getMatrixNumRows ( ) const
inline

Definition at line 660 of file APValue.h.

References isMatrix().

Referenced by APValue(), getMatrixElt(), getMatrixNumElements(), printPretty(), and Profile().

◆ getMemberPointerDecl()

◆ getMemberPointerPath()

◆ getReflectionOpaqueOperand()

const void * clang::APValue::getReflectionOpaqueOperand ( ) const
inline

◆ getReflectionOperandKind()

ReflectionKind clang::APValue::getReflectionOperandKind ( ) const
inline

Definition at line 782 of file APValue.h.

References isReflection().

Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), and printPretty().

◆ getStructBase() [1/2]

APValue & clang::APValue::getStructBase ( unsigned i)
inline

◆ getStructBase() [2/2]

const APValue & clang::APValue::getStructBase ( unsigned i) const
inline

Definition at line 747 of file APValue.h.

References APValue(), and getStructBase().

◆ getStructField() [1/2]

◆ getStructField() [2/2]

const APValue & clang::APValue::getStructField ( unsigned i) const
inline

Definition at line 750 of file APValue.h.

References APValue(), and getStructField().

◆ getStructNumBases()

◆ getStructNumFields()

unsigned clang::APValue::getStructNumFields ( ) const
inline

◆ getStructNumVirtualBases()

unsigned clang::APValue::getStructNumVirtualBases ( ) const
inline

◆ getStructVirtualBase() [1/2]

◆ getStructVirtualBase() [2/2]

const APValue & clang::APValue::getStructVirtualBase ( unsigned i) const
inline

Definition at line 753 of file APValue.h.

References APValue(), and getStructVirtualBase().

◆ getUnionField()

const FieldDecl * clang::APValue::getUnionField ( ) const
inline

◆ getUnionValue() [1/2]

◆ getUnionValue() [2/2]

const APValue & clang::APValue::getUnionValue ( ) const
inline

Definition at line 765 of file APValue.h.

References APValue(), and getUnionValue().

◆ getVectorElt() [1/2]

◆ getVectorElt() [2/2]

const APValue & clang::APValue::getVectorElt ( unsigned I) const
inline

Definition at line 652 of file APValue.h.

References APValue(), and getVectorElt().

◆ getVectorLength()

◆ hasArrayFiller()

bool clang::APValue::hasArrayFiller ( ) const
inline

◆ hasLValuePath()

◆ hasValue()

bool clang::APValue::hasValue ( ) const
inline

◆ IndeterminateValue()

APValue clang::APValue::IndeterminateValue ( )
inlinestatic

◆ isAbsent()

◆ isAddrLabelDiff()

bool clang::APValue::isAddrLabelDiff ( ) const
inline

Definition at line 561 of file APValue.h.

References AddrLabelDiff.

Referenced by getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), and GetValueRange().

◆ isArray()

◆ isComplexFloat()

bool clang::APValue::isComplexFloat ( ) const
inline

◆ isComplexInt()

bool clang::APValue::isComplexInt ( ) const
inline

Definition at line 552 of file APValue.h.

References ComplexInt.

Referenced by findSubobject(), getComplexIntImag(), getComplexIntReal(), GetValueRange(), and setComplexInt().

◆ isFixedPoint()

bool clang::APValue::isFixedPoint ( ) const
inline

Definition at line 551 of file APValue.h.

References FixedPoint.

Referenced by EvaluateFixedPoint(), getFixedPoint(), and setFixedPoint().

◆ isFloat()

◆ isIndeterminate()

◆ isInt()

◆ isLValue()

◆ isLValueOnePastTheEnd()

bool APValue::isLValueOnePastTheEnd ( ) const

Definition at line 1131 of file APValue.cpp.

References isLValue().

Referenced by APValue(), clang::ASTNodeImporter::ImportAPValue(), printPretty(), and Profile().

◆ isMatrix()

bool clang::APValue::isMatrix ( ) const
inline

◆ isMemberPointer()

◆ isMemberPointerToDerivedMember()

◆ isNullPointer()

◆ isReflection()

bool clang::APValue::isReflection ( ) const
inline

Definition at line 562 of file APValue.h.

References Reflection.

Referenced by getReflectionOpaqueOperand(), and getReflectionOperandKind().

◆ isStruct()

◆ isUnion()

bool clang::APValue::isUnion ( ) const
inline

◆ isVector()

bool clang::APValue::isVector ( ) const
inline

◆ needsCleanup()

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 500 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, Reflection, Struct, Union, and Vector.

Referenced by needsCleanup(), and clang::ASTDeclReader::ReadVarDeclInit().

◆ operator=() [1/2]

APValue & APValue::operator= ( APValue && RHS)

Definition at line 455 of file APValue.cpp.

References APValue(), Indeterminate, and None.

◆ operator=() [2/2]

APValue & APValue::operator= ( const APValue & RHS)

Definition at line 448 of file APValue.cpp.

References APValue().

◆ printPretty() [1/2]

void APValue::printPretty ( raw_ostream & OS,
const ASTContext & Ctx,
QualType Ty ) const

◆ printPretty() [2/2]

void APValue::printPretty ( raw_ostream & OS,
const PrintingPolicy & Policy,
QualType Ty,
const ASTContext * Ctx = nullptr ) const

Definition at line 815 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, 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(), getReflectionOpaqueOperand(), getReflectionOperandKind(), getStructBase(), getStructField(), getStructNumBases(), getStructNumVirtualBases(), getStructVirtualBase(), 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::Null, clang::PrintingPolicy::Nullptr, clang::CharUnits::One(), printPretty(), clang::Stmt::printPretty(), Reflection, clang::QualType::stream(), Struct, TryPrintAsStringLiteral(), clang::Type, Union, clang::CXXRecordDecl::vbases_begin(), clang::CXXRecordDecl::vbases_end(), Vector, and clang::CharUnits::Zero().

◆ Profile()

void APValue::Profile ( llvm::FoldingSetNodeID & ID) const

◆ setAddrLabelDiff()

void clang::APValue::setAddrLabelDiff ( const AddrLabelExpr * LHSExpr,
const AddrLabelExpr * RHSExpr )
inline

Definition at line 832 of file APValue.h.

Referenced by APValue(), and APValue().

◆ setComplexFloat()

void clang::APValue::setComplexFloat ( APFloat R,
APFloat I )
inline

Definition at line 821 of file APValue.h.

References isComplexFloat().

Referenced by APValue(), and APValue().

◆ setComplexInt()

void clang::APValue::setComplexInt ( APSInt R,
APSInt I )
inline

Definition at line 814 of file APValue.h.

References isComplexInt().

Referenced by APValue(), and APValue().

◆ setConstexprUnknown()

void clang::APValue::setConstexprUnknown ( bool IsConstexprUnknown = true)
inline

Definition at line 380 of file APValue.h.

◆ setFixedPoint()

void clang::APValue::setFixedPoint ( APFixedPoint FX)
inline

Definition at line 800 of file APValue.h.

References isFixedPoint().

◆ setFloat()

void clang::APValue::setFloat ( APFloat F)
inline

Definition at line 796 of file APValue.h.

References isFloat().

◆ setInt()

void clang::APValue::setInt ( APSInt I)
inline

Definition at line 792 of file APValue.h.

References isInt().

◆ setLValue() [1/2]

void APValue::setLValue ( LValueBase B,
CharUnits O,
ArrayRef< LValuePathEntry > Path,
bool OnePastTheEnd,
bool IsNullPtr )

Definition at line 1191 of file APValue.cpp.

References memcpy().

◆ setLValue() [2/2]

void APValue::setLValue ( LValueBase B,
CharUnits O,
NoLValuePath ,
bool IsNullPtr )

Definition at line 1167 of file APValue.cpp.

References isLValue(), and clang::APValue::LV::resizePath().

Referenced by APValue(), APValue(), APValue(), and APValue().

◆ setMatrix()

void clang::APValue::setMatrix ( const APValue * E,
unsigned NumRows,
unsigned NumCols )
inline

Definition at line 809 of file APValue.h.

References APValue().

Referenced by APValue(), and APValue().

◆ setUnion()

void APValue::setUnion ( const FieldDecl * Field,
const APValue & Value )

Definition at line 1202 of file APValue.cpp.

References APValue(), and isUnion().

Referenced by APValue(), APValue(), and findSubobject().

◆ setVector()

void clang::APValue::setVector ( const APValue * E,
unsigned N )
inline

Definition at line 804 of file APValue.h.

References APValue().

Referenced by APValue(), and APValue().

◆ swap()

void APValue::swap ( APValue & RHS)

Swaps the contents of this and the given APValue.

Definition at line 539 of file APValue.cpp.

References APValue().

Referenced by expandArray().

◆ toIntegralConstant()

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 1106 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().

◆ visit()

void APValue::visit ( llvm::function_ref< bool(const APValue &)> Visitor) const

Visit this value and every recursively nested value.

Iteration order is unspecified.

Visitation stops if Visitor returns false.

Definition at line 81 of file APValue.cpp.

References APValue(), and visitAPValue().

◆ ASTImporter

friend class ASTImporter
friend

Definition at line 292 of file APValue.h.

References ASTImporter.

Referenced by ASTImporter.

◆ ASTNodeImporter

friend class ASTNodeImporter
friend

Definition at line 293 of file APValue.h.

References ASTNodeImporter.

Referenced by ASTNodeImporter.

◆ clang::serialization::BasicReaderBase

template<typename Impl>
friend class clang::serialization::BasicReaderBase
friend

Definition at line 291 of file APValue.h.


The documentation for this class was generated from the following files: