class APValue

Declaration

class APValue { /* full declaration omitted */ };

Description

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

Declared at: clang/include/clang/AST/APValue.h:122

Member Variables

private clang::APValue::ValueKind Kind
private clang::APValue::DataType Data
private static const size_t DataSize = sizeof(llvm::AlignedCharArrayUnion<void *, llvm::APSInt, llvm::APFloat, clang::APValue::ComplexAPSInt, clang::APValue::ComplexAPFloat, clang::APValue::Vec, clang::APValue::Arr, clang::APValue::StructData, clang::APValue::UnionData, clang::APValue::AddrLabelDiffData>)

Method Overview

Methods

APValue(clang::APValue::APSInt I)

Declared at: clang/include/clang/AST/APValue.h:310

Parameters

clang::APValue::APSInt I

APValue()

Declared at: clang/include/clang/AST/APValue.h:309

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

Declared at: clang/include/clang/AST/APValue.h:354

Parameters

const clang::AddrLabelExpr* LHSExpr
const clang::AddrLabelExpr* RHSExpr

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

Declared at: clang/include/clang/AST/APValue.h:350

Parameters

const clang::ValueDecl* Member
bool IsDerivedMember
ArrayRef<const clang::CXXRecordDecl*> Path

APValue(
    const clang::FieldDecl* D,
    const clang::APValue& V = clang::APValue())

Declared at: clang/include/clang/AST/APValue.h:346

Parameters

const clang::FieldDecl* D
const clang::APValue& V = clang::APValue()

APValue(clang::APValue::UninitStruct,
        unsigned int B,
        unsigned int M)

Declared at: clang/include/clang/AST/APValue.h:343

Parameters

clang::APValue::UninitStruct
unsigned int B
unsigned int M

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

Declared at: clang/include/clang/AST/APValue.h:340

Parameters

clang::APValue::UninitArray
unsigned int InitElts
unsigned int Size

APValue(clang::APValue::LValueBase B,
        const clang::CharUnits& O,
        ArrayRef<clang::APValue::LValuePathEntry>
            Path,
        bool OnePastTheEnd,
        bool IsNullPtr = false)

Declared at: clang/include/clang/AST/APValue.h:335

Parameters

clang::APValue::LValueBase B
const clang::CharUnits& O
ArrayRef<clang::APValue::LValuePathEntry> Path
bool OnePastTheEnd
bool IsNullPtr = false

APValue(clang::APValue::LValueBase B,
        const clang::CharUnits& O,
        clang::APValue::NoLValuePath N,
        bool IsNullPtr = false)

Declared at: clang/include/clang/AST/APValue.h:330

Parameters

clang::APValue::LValueBase B
const clang::CharUnits& O
clang::APValue::NoLValuePath N
bool IsNullPtr = false

APValue(clang::APValue&& RHS)

Declared at: clang/include/clang/AST/APValue.h:329

Parameters

clang::APValue&& RHS

APValue(const clang::APValue& RHS)

Declared at: clang/include/clang/AST/APValue.h:328

Parameters

const clang::APValue& RHS

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

Declared at: clang/include/clang/AST/APValue.h:325

Parameters

clang::APValue::APFloat R
clang::APValue::APFloat I

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

Declared at: clang/include/clang/AST/APValue.h:322

Parameters

clang::APValue::APSInt R
clang::APValue::APSInt I

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

Declared at: clang/include/clang/AST/APValue.h:319

Parameters

const clang::APValue* E
unsigned int N

APValue(clang::APValue::APFixedPoint FX)

Declared at: clang/include/clang/AST/APValue.h:316

Parameters

clang::APValue::APFixedPoint FX

APValue(clang::APValue::APFloat F)

Declared at: clang/include/clang/AST/APValue.h:313

Parameters

clang::APValue::APFloat F

void DestroyDataAndMakeUninit()

Declared at: clang/include/clang/AST/APValue.h:624

static clang::APValue IndeterminateValue()

Declared at: clang/include/clang/AST/APValue.h:358

void MakeAddrLabelDiff()

Declared at: clang/include/clang/AST/APValue.h:669

void MakeArray(unsigned int InitElts,
               unsigned int Size)

Declared at: clang/include/clang/AST/APValue.h:656

Parameters

unsigned int InitElts
unsigned int Size

void MakeComplexFloat()

Declared at: clang/include/clang/AST/APValue.h:650

void MakeComplexInt()

Declared at: clang/include/clang/AST/APValue.h:645

void MakeFixedPoint(
    clang::APValue::APFixedPoint&& FX)

Declared at: clang/include/clang/AST/APValue.h:635

Parameters

clang::APValue::APFixedPoint&& FX

void MakeFloat()

Declared at: clang/include/clang/AST/APValue.h:630

void MakeInt()

Declared at: clang/include/clang/AST/APValue.h:625

void MakeLValue()

Declared at: clang/include/clang/AST/APValue.h:655

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

Declared at: clang/include/clang/AST/APValue.h:667

Parameters

const clang::ValueDecl* Member
bool IsDerivedMember
ArrayRef<const clang::CXXRecordDecl*> Path

void MakeStruct(unsigned int B, unsigned int M)

Declared at: clang/include/clang/AST/APValue.h:657

Parameters

unsigned int B
unsigned int M

void MakeUnion()

Declared at: clang/include/clang/AST/APValue.h:662

void MakeVector()

Declared at: clang/include/clang/AST/APValue.h:640

void Profile(llvm::FoldingSetNodeID& ID) const

Description

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.

Declared at: clang/include/clang/AST/APValue.h:385

Parameters

llvm::FoldingSetNodeID& ID

void dump() const

Declared at: clang/include/clang/AST/APValue.h:406

void dump(llvm::raw_ostream& OS,
          const clang::ASTContext& Context) const

Declared at: clang/include/clang/AST/APValue.h:407

Parameters

llvm::raw_ostream& OS
const clang::ASTContext& Context

const clang::AddrLabelExpr* getAddrLabelDiffLHS()
    const

Declared at: clang/include/clang/AST/APValue.h:571

const clang::AddrLabelExpr* getAddrLabelDiffRHS()
    const

Declared at: clang/include/clang/AST/APValue.h:575

clang::APValue& getArrayFiller()

Declared at: clang/include/clang/AST/APValue.h:513

const clang::APValue& getArrayFiller() const

Declared at: clang/include/clang/AST/APValue.h:518

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

Declared at: clang/include/clang/AST/APValue.h:507

Parameters

unsigned int I

clang::APValue& getArrayInitializedElt(
    unsigned int I)

Declared at: clang/include/clang/AST/APValue.h:502

Parameters

unsigned int I

unsigned int getArrayInitializedElts() const

Declared at: clang/include/clang/AST/APValue.h:521

unsigned int getArraySize() const

Declared at: clang/include/clang/AST/APValue.h:525

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

Declared at: clang/include/clang/AST/APValue.h:413

Parameters

const clang::ASTContext& Ctx
clang::QualType Ty

clang::APValue::APFloat& getComplexFloatImag()

Declared at: clang/include/clang/AST/APValue.h:469

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

Declared at: clang/include/clang/AST/APValue.h:473

clang::APValue::APFloat& getComplexFloatReal()

Declared at: clang/include/clang/AST/APValue.h:461

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

Declared at: clang/include/clang/AST/APValue.h:465

clang::APValue::APSInt& getComplexIntImag()

Declared at: clang/include/clang/AST/APValue.h:453

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

Declared at: clang/include/clang/AST/APValue.h:457

clang::APValue::APSInt& getComplexIntReal()

Declared at: clang/include/clang/AST/APValue.h:445

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

Declared at: clang/include/clang/AST/APValue.h:449

clang::APValue::APFixedPoint& getFixedPoint()

Declared at: clang/include/clang/AST/APValue.h:437

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

Declared at: clang/include/clang/AST/APValue.h:441

clang::APValue::APFloat& getFloat()

Declared at: clang/include/clang/AST/APValue.h:429

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

Declared at: clang/include/clang/AST/APValue.h:433

clang::APValue::APSInt& getInt()

Declared at: clang/include/clang/AST/APValue.h:415

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

Declared at: clang/include/clang/AST/APValue.h:419

clang::APValue::ValueKind getKind() const

Declared at: clang/include/clang/AST/APValue.h:387

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

Declared at: clang/include/clang/AST/APValue.h:477

unsigned int getLValueCallIndex() const

Declared at: clang/include/clang/AST/APValue.h:485

clang::CharUnits& getLValueOffset()

Declared at: clang/include/clang/AST/APValue.h:478

const clang::CharUnits& getLValueOffset() const

Declared at: clang/include/clang/AST/APValue.h:479

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

Declared at: clang/include/clang/AST/APValue.h:484

unsigned int getLValueVersion() const

Declared at: clang/include/clang/AST/APValue.h:486

const clang::ValueDecl* getMemberPointerDecl()
    const

Declared at: clang/include/clang/AST/APValue.h:567

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

Declared at: clang/include/clang/AST/APValue.h:569

clang::APValue& getStructBase(unsigned int i)

Declared at: clang/include/clang/AST/APValue.h:538

Parameters

unsigned int i

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

Declared at: clang/include/clang/AST/APValue.h:548

Parameters

unsigned int i

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

Declared at: clang/include/clang/AST/APValue.h:551

Parameters

unsigned int i

clang::APValue& getStructField(unsigned int i)

Declared at: clang/include/clang/AST/APValue.h:543

Parameters

unsigned int i

unsigned int getStructNumBases() const

Declared at: clang/include/clang/AST/APValue.h:530

unsigned int getStructNumFields() const

Declared at: clang/include/clang/AST/APValue.h:534

const clang::FieldDecl* getUnionField() const

Declared at: clang/include/clang/AST/APValue.h:555

const clang::APValue& getUnionValue() const

Declared at: clang/include/clang/AST/APValue.h:563

clang::APValue& getUnionValue()

Declared at: clang/include/clang/AST/APValue.h:559

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

Declared at: clang/include/clang/AST/APValue.h:494

Parameters

unsigned int I

clang::APValue& getVectorElt(unsigned int I)

Declared at: clang/include/clang/AST/APValue.h:489

Parameters

unsigned int I

unsigned int getVectorLength() const

Declared at: clang/include/clang/AST/APValue.h:497

bool hasArrayFiller() const

Declared at: clang/include/clang/AST/APValue.h:510

bool hasLValuePath() const

Declared at: clang/include/clang/AST/APValue.h:483

bool hasValue() const

Declared at: clang/include/clang/AST/APValue.h:391

bool isAbsent() const

Declared at: clang/include/clang/AST/APValue.h:389

bool isAddrLabelDiff() const

Declared at: clang/include/clang/AST/APValue.h:404

bool isArray() const

Declared at: clang/include/clang/AST/APValue.h:400

bool isComplexFloat() const

Declared at: clang/include/clang/AST/APValue.h:397

bool isComplexInt() const

Declared at: clang/include/clang/AST/APValue.h:396

bool isFixedPoint() const

Declared at: clang/include/clang/AST/APValue.h:395

bool isFloat() const

Declared at: clang/include/clang/AST/APValue.h:394

bool isIndeterminate() const

Declared at: clang/include/clang/AST/APValue.h:390

bool isInt() const

Declared at: clang/include/clang/AST/APValue.h:393

bool isLValue() const

Declared at: clang/include/clang/AST/APValue.h:398

bool isLValueOnePastTheEnd() const

Declared at: clang/include/clang/AST/APValue.h:482

bool isMemberPointer() const

Declared at: clang/include/clang/AST/APValue.h:403

bool isMemberPointerToDerivedMember() const

Declared at: clang/include/clang/AST/APValue.h:568

bool isNullPointer() const

Declared at: clang/include/clang/AST/APValue.h:487

bool isStruct() const

Declared at: clang/include/clang/AST/APValue.h:401

bool isUnion() const

Declared at: clang/include/clang/AST/APValue.h:402

bool isVector() const

Declared at: clang/include/clang/AST/APValue.h:399

bool needsCleanup() const

Description

Returns whether the object performed allocations. If APValues are constructed via placement new, \c needsCleanup() indicates whether the destructor must be called in order to correctly free all allocated memory.

Declared at: clang/include/clang/AST/APValue.h:377

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

Declared at: clang/include/clang/AST/APValue.h:410

Parameters

llvm::raw_ostream& OS
const clang::PrintingPolicy& Policy
clang::QualType Ty
const clang::ASTContext* Ctx = nullptr

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

Declared at: clang/include/clang/AST/APValue.h:409

Parameters

llvm::raw_ostream& OS
const clang::ASTContext& Ctx
clang::QualType Ty

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

Declared at: clang/include/clang/AST/APValue.h:617

Parameters

const clang::AddrLabelExpr* LHSExpr
const clang::AddrLabelExpr* RHSExpr

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

Declared at: clang/include/clang/AST/APValue.h:604

Parameters

clang::APValue::APFloat R
clang::APValue::APFloat I

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

Declared at: clang/include/clang/AST/APValue.h:597

Parameters

clang::APValue::APSInt R
clang::APValue::APSInt I

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

Declared at: clang/include/clang/AST/APValue.h:588

Parameters

clang::APValue::APFixedPoint FX

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

Declared at: clang/include/clang/AST/APValue.h:584

Parameters

clang::APValue::APFloat F

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

Declared at: clang/include/clang/AST/APValue.h:580

Parameters

clang::APValue::APSInt I

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

Declared at: clang/include/clang/AST/APValue.h:611

Parameters

clang::APValue::LValueBase B
const clang::CharUnits& O
clang::APValue::NoLValuePath
bool IsNullPtr

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

Declared at: clang/include/clang/AST/APValue.h:613

Parameters

clang::APValue::LValueBase B
const clang::CharUnits& O
ArrayRef<clang::APValue::LValuePathEntry> Path
bool OnePastTheEnd
bool IsNullPtr

MutableArrayRef<clang::APValue::LValuePathEntry>
setLValueUninit(clang::APValue::LValueBase B,
                const clang::CharUnits& O,
                unsigned int Size,
                bool OnePastTheEnd,
                bool IsNullPtr)

Declared at: clang/include/clang/AST/APValue.h:687

Parameters

clang::APValue::LValueBase B
const clang::CharUnits& O
unsigned int Size
bool OnePastTheEnd
bool IsNullPtr

MutableArrayRef<const clang::CXXRecordDecl*>
setMemberPointerUninit(
    const clang::ValueDecl* Member,
    bool IsDerivedMember,
    unsigned int Size)

Declared at: clang/include/clang/AST/APValue.h:690

Parameters

const clang::ValueDecl* Member
bool IsDerivedMember
unsigned int Size

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

Declared at: clang/include/clang/AST/APValue.h:616

Parameters

const clang::FieldDecl* Field
const clang::APValue& Value

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

Declared at: clang/include/clang/AST/APValue.h:592

Parameters

const clang::APValue* E
unsigned int N

MutableArrayRef<clang::APValue> setVectorUninit(
    unsigned int N)

Description

The following functions are used as part of initialization, during deserialization and importing. Reserve the space so that it can be filled in by those steps.

Declared at: clang/include/clang/AST/APValue.h:679

Parameters

unsigned int N

void swap(clang::APValue& RHS)

Description

Swaps the contents of this and the given APValue.

Declared at: clang/include/clang/AST/APValue.h:380

Parameters

clang::APValue& RHS

bool toIntegralConstant(
    clang::APValue::APSInt& Result,
    clang::QualType SrcTy,
    const clang::ASTContext& Ctx) const

Description

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.

Declared at: clang/include/clang/AST/APValue.h:426

Parameters

clang::APValue::APSInt& Result
clang::QualType SrcTy
const clang::ASTContext& Ctx

~APValue()

Declared at: clang/include/clang/AST/APValue.h:367