clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
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 , Array , Struct , Union ,
  MemberPointer , AddrLabelDiff
}
 
typedef llvm::PointerIntPair< const Decl *, 1, boolBaseOrMemberType
 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.
 
APValueoperator= (const APValue &RHS)
 
APValueoperator= (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
 
CharUnitsgetLValueOffset ()
 
const CharUnitsgetLValueOffset () const
 
bool isLValueOnePastTheEnd () const
 
bool hasLValuePath () const
 
ArrayRef< LValuePathEntrygetLValuePath () const
 
unsigned getLValueCallIndex () const
 
unsigned getLValueVersion () const
 
bool isNullPointer () const
 
APValuegetVectorElt (unsigned I)
 
const APValuegetVectorElt (unsigned I) const
 
unsigned getVectorLength () const
 
APValuegetArrayInitializedElt (unsigned I)
 
const APValuegetArrayInitializedElt (unsigned I) const
 
bool hasArrayFiller () const
 
APValuegetArrayFiller ()
 
const APValuegetArrayFiller () const
 
unsigned getArrayInitializedElts () const
 
unsigned getArraySize () const
 
unsigned getStructNumBases () const
 
unsigned getStructNumFields () const
 
APValuegetStructBase (unsigned i)
 
APValuegetStructField (unsigned i)
 
const APValuegetStructBase (unsigned i) const
 
const APValuegetStructField (unsigned i) const
 
const FieldDeclgetUnionField () const
 
APValuegetUnionValue ()
 
const APValuegetUnionValue () const
 
const ValueDeclgetMemberPointerDecl () const
 
bool isMemberPointerToDerivedMember () const
 
ArrayRef< const CXXRecordDecl * > getMemberPointerPath () const
 
const AddrLabelExprgetAddrLabelDiffLHS () const
 
const AddrLabelExprgetAddrLabelDiffRHS () 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
 

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 122 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 203 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 
Array 
Struct 
Union 
MemberPointer 
AddrLabelDiff 

Definition at line 127 of file APValue.h.

Constructor & Destructor Documentation

◆ APValue() [1/17]

clang::APValue::APValue ( )
inline

Creates an empty APValue of type None.

Definition at line 324 of file APValue.h.

Referenced by operator=().

◆ APValue() [2/17]

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

Creates an integer APValue holding the given value.

Definition at line 326 of file APValue.h.

References setInt().

◆ APValue() [3/17]

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

Creates a float APValue holding the given value.

Definition at line 330 of file APValue.h.

References setFloat().

◆ APValue() [4/17]

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

Creates a fixed-point APValue holding the given value.

Definition at line 334 of file APValue.h.

◆ APValue() [5/17]

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 339 of file APValue.h.

References E, and setVector().

◆ APValue() [6/17]

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

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

Definition at line 345 of file APValue.h.

References setComplexInt().

◆ APValue() [7/17]

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

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

Definition at line 349 of file APValue.h.

References setComplexFloat().

◆ APValue() [8/17]

APValue::APValue ( const APValue RHS)

◆ APValue() [9/17]

APValue::APValue ( APValue &&  RHS)

Definition at line 383 of file APValue.cpp.

References None.

◆ APValue() [10/17]

clang::APValue::APValue ( LValueBase  Base,
const 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 358 of file APValue.h.

References setLValue().

◆ APValue() [11/17]

clang::APValue::APValue ( LValueBase  Base,
const 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 371 of file APValue.h.

References Path, and setLValue().

◆ APValue() [12/17]

clang::APValue::APValue ( LValueBase  Base,
const 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 382 of file APValue.h.

References setLValue().

◆ APValue() [13/17]

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 394 of file APValue.h.

◆ APValue() [14/17]

clang::APValue::APValue ( UninitStruct  ,
unsigned  NumBases,
unsigned  NumMembers 
)
inline

Creates a new struct APValue.

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

Definition at line 402 of file APValue.h.

◆ APValue() [15/17]

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 409 of file APValue.h.

References setUnion().

◆ APValue() [16/17]

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 419 of file APValue.h.

References clang::Member, and Path.

◆ APValue() [17/17]

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 427 of file APValue.h.

References setAddrLabelDiff().

◆ ~APValue()

clang::APValue::~APValue ( )
inline

Definition at line 440 of file APValue.h.

References Indeterminate, Kind, and None.

Member Function Documentation

◆ allowConstexprUnknown()

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

Definition at line 317 of file APValue.h.

Referenced by findSubobject(), and 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

Definition at line 644 of file APValue.h.

References Data, and isAddrLabelDiff().

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

◆ getAddrLabelDiffRHS()

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

Definition at line 648 of file APValue.h.

References Data, and isAddrLabelDiff().

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

◆ getArrayFiller() [1/2]

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

◆ getArrayFiller() [2/2]

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

Definition at line 591 of file APValue.h.

References getArrayFiller().

◆ getArrayInitializedElt() [1/2]

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

◆ getArrayInitializedElt() [2/2]

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

Definition at line 580 of file APValue.h.

References getArrayInitializedElt().

◆ getArrayInitializedElts()

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

◆ getArraySize()

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

◆ getAsString()

std::string APValue::getAsString ( const ASTContext Ctx,
QualType  Ty 
) const

◆ getComplexFloatImag() [1/2]

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

◆ getComplexFloatImag() [2/2]

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

Definition at line 546 of file APValue.h.

References getComplexFloatImag().

◆ getComplexFloatReal() [1/2]

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

◆ getComplexFloatReal() [2/2]

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

Definition at line 538 of file APValue.h.

References getComplexFloatReal().

◆ getComplexIntImag() [1/2]

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

◆ getComplexIntImag() [2/2]

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

Definition at line 530 of file APValue.h.

References getComplexIntImag().

◆ getComplexIntReal() [1/2]

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

◆ getComplexIntReal() [2/2]

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

Definition at line 522 of file APValue.h.

References getComplexIntReal().

◆ getFixedPoint() [1/2]

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

◆ getFixedPoint() [2/2]

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

Definition at line 514 of file APValue.h.

References getFixedPoint().

◆ getFloat() [1/2]

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

◆ getFloat() [2/2]

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

Definition at line 506 of file APValue.h.

References getFloat().

◆ getInt() [1/2]

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

◆ getInt() [2/2]

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

Definition at line 492 of file APValue.h.

References getInt().

◆ getKind()

ValueKind clang::APValue::getKind ( ) const
inline

◆ getLValueBase()

const APValue::LValueBase APValue::getLValueBase ( ) const

◆ getLValueCallIndex()

unsigned APValue::getLValueCallIndex ( ) const

Definition at line 1010 of file APValue.cpp.

References isLValue().

◆ getLValueOffset() [1/2]

CharUnits & APValue::getLValueOffset ( )

◆ getLValueOffset() [2/2]

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

Definition at line 552 of file APValue.h.

References getLValueOffset().

◆ getLValuePath()

ArrayRef< APValue::LValuePathEntry > APValue::getLValuePath ( ) const

◆ getLValueVersion()

unsigned APValue::getLValueVersion ( ) const

Definition at line 1015 of file APValue.cpp.

References isLValue().

◆ getMemberPointerDecl()

const ValueDecl * APValue::getMemberPointerDecl ( ) const

◆ getMemberPointerPath()

ArrayRef< const CXXRecordDecl * > APValue::getMemberPointerPath ( ) const

◆ getStructBase() [1/2]

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

Definition at line 611 of file APValue.h.

References Data, getStructNumBases(), and isStruct().

Referenced by APValue(), findSubobject(), getStructBase(), printPretty(), and Profile().

◆ getStructBase() [2/2]

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

Definition at line 621 of file APValue.h.

References getStructBase().

◆ getStructField() [1/2]

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

◆ getStructField() [2/2]

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

Definition at line 624 of file APValue.h.

References getStructField().

◆ getStructNumBases()

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

◆ getStructNumFields()

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

◆ getUnionField()

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

◆ getUnionValue() [1/2]

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

◆ getUnionValue() [2/2]

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

Definition at line 636 of file APValue.h.

References getUnionValue().

◆ getVectorElt() [1/2]

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

◆ getVectorElt() [2/2]

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

Definition at line 567 of file APValue.h.

References getVectorElt().

◆ getVectorLength()

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

◆ hasArrayFiller()

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

Definition at line 583 of file APValue.h.

References getArrayInitializedElts(), and getArraySize().

Referenced by APValue(), expandArray(), getArrayFiller(), and Profile().

◆ hasLValuePath()

bool APValue::hasLValuePath ( ) const

◆ hasValue()

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

◆ IndeterminateValue()

static APValue clang::APValue::IndeterminateValue ( )
inlinestatic

Definition at line 431 of file APValue.h.

References Indeterminate, and clang::Result.

Referenced by clang::ConstantExpr::getAPValueResult(), and handleDefaultInitValue().

◆ isAbsent()

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

◆ isAddrLabelDiff()

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

Definition at line 477 of file APValue.h.

References AddrLabelDiff, and Kind.

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

◆ isArray()

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

◆ isComplexFloat()

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

◆ isComplexInt()

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

Definition at line 469 of file APValue.h.

References ComplexInt, and Kind.

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

◆ isFixedPoint()

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

Definition at line 468 of file APValue.h.

References FixedPoint, and Kind.

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

◆ isFloat()

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

◆ isIndeterminate()

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

Definition at line 463 of file APValue.h.

References Indeterminate, and Kind.

Referenced by findSubobject(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().

◆ isInt()

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

◆ isLValue()

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

◆ isLValueOnePastTheEnd()

bool APValue::isLValueOnePastTheEnd ( ) const

Definition at line 989 of file APValue.cpp.

References isLValue().

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

◆ isMemberPointer()

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

◆ isMemberPointerToDerivedMember()

bool APValue::isMemberPointerToDerivedMember ( ) const

◆ isNullPointer()

bool APValue::isNullPointer ( ) const

◆ isStruct()

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

◆ isUnion()

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

◆ isVector()

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

Definition at line 472 of file APValue.h.

References Kind, and Vector.

Referenced by GetValueRange(), getVectorElt(), getVectorLength(), handleVectorVectorBinOp(), and IsSameFloatAfterCast().

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

◆ operator=() [1/2]

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

Definition at line 397 of file APValue.cpp.

References Indeterminate, and None.

◆ operator=() [2/2]

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

Definition at line 389 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 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().

◆ Profile()

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

◆ setAddrLabelDiff()

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

Definition at line 690 of file APValue.h.

References Data.

Referenced by APValue().

◆ setComplexFloat()

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

Definition at line 677 of file APValue.h.

References Data, and isComplexFloat().

Referenced by APValue().

◆ setComplexInt()

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

Definition at line 670 of file APValue.h.

References Data, and isComplexInt().

Referenced by APValue().

◆ setConstexprUnknown()

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

Definition at line 319 of file APValue.h.

◆ setFixedPoint()

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

Definition at line 661 of file APValue.h.

References Data, and isFixedPoint().

◆ setFloat()

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

Definition at line 657 of file APValue.h.

References Data, and isFloat().

Referenced by APValue().

◆ setInt()

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

Definition at line 653 of file APValue.h.

References Data, and isInt().

Referenced by APValue().

◆ setLValue() [1/2]

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

Definition at line 1049 of file APValue.cpp.

References memcpy(), and Path.

◆ setLValue() [2/2]

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

◆ setUnion()

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

Definition at line 1060 of file APValue.cpp.

References isUnion().

Referenced by APValue(), and findSubobject().

◆ setVector()

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

Definition at line 665 of file APValue.h.

References E.

Referenced by APValue().

◆ swap()

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

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

Friends And Related Function Documentation

◆ ASTImporter

friend class ASTImporter
friend

Definition at line 253 of file APValue.h.

◆ ASTNodeImporter

friend class ASTNodeImporter
friend

Definition at line 254 of file APValue.h.

◆ clang::serialization::BasicReaderBase

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

Definition at line 252 of file APValue.h.


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