class PointerType

Declaration

class PointerType : public Type { /* full declaration omitted */ };

Description

Class to represent pointers.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:632

Inherits from: Type

Member Variables

private llvm::Type* PointeeTy

Inherited from Type:

protected NumContainedTys = 0
protected ContainedTys = nullptr

Method Overview

Inherited from Type:

Methods

PointerType(llvm::Type* ElType,
            unsigned int AddrSpace)

Declared at: llvm/include/llvm/IR/DerivedTypes.h:633

Parameters

llvm::Type* ElType
unsigned int AddrSpace

PointerType(llvm::LLVMContext& C,
            unsigned int AddrSpace)

Declared at: llvm/include/llvm/IR/DerivedTypes.h:634

Parameters

llvm::LLVMContext& C
unsigned int AddrSpace

PointerType(const llvm::PointerType&)

Declared at: llvm/include/llvm/IR/DerivedTypes.h:639

Parameters

const llvm::PointerType&

static bool classof(const llvm::Type* T)

Description

Implement support type inquiry through isa, cast, and dyn_cast.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:701

Parameters

const llvm::Type* T

static llvm::PointerType* get(
    llvm::Type* ElementType,
    unsigned int AddressSpace)

Description

This constructs a pointer to an object of the specified type in a numbered address space.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:644

Parameters

llvm::Type* ElementType
unsigned int AddressSpace

static llvm::PointerType* get(
    llvm::LLVMContext& C,
    unsigned int AddressSpace)

Description

This constructs an opaque pointer to an object in a numbered address space.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:647

Parameters

llvm::LLVMContext& C
unsigned int AddressSpace

inline unsigned int getAddressSpace() const

Description

Return the address space of the Pointer type.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:682

static llvm::PointerType* getUnqual(
    llvm::Type* ElementType)

Description

This constructs a pointer to an object of the specified type in the default address space (address space zero).

Declared at: llvm/include/llvm/IR/DerivedTypes.h:651

Parameters

llvm::Type* ElementType

static llvm::PointerType* getUnqual(
    llvm::LLVMContext& C)

Description

This constructs an opaque pointer to an object in the default address space (address space zero).

Declared at: llvm/include/llvm/IR/DerivedTypes.h:657

Parameters

llvm::LLVMContext& C

static llvm::PointerType* getWithSamePointeeType(
    llvm::PointerType* PT,
    unsigned int AddressSpace)

Description

This constructs a pointer type with the same pointee type as input PointerType (or opaque pointer if the input PointerType is opaque) and the given address space. This is only useful during the opaque pointer transition. TODO: remove after opaque pointer transition is complete.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:666

Parameters

llvm::PointerType* PT
unsigned int AddressSpace

bool hasSameElementTypeAs(
    llvm::PointerType* Other)

Description

Return true if both pointer types have the same element type. Two opaque pointers are considered to have the same element type, while an opaque and a non-opaque pointer have different element types. TODO: Remove after opaque pointer transition is complete.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:696

Parameters

llvm::PointerType* Other

static bool isLoadableOrStorableType(
    llvm::Type* ElemTy)

Description

Return true if we can load or store from a pointer to this type.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:679

Parameters

llvm::Type* ElemTy

bool isOpaque() const

Declared at: llvm/include/llvm/IR/DerivedTypes.h:673

bool isOpaqueOrPointeeTypeMatches(llvm::Type* Ty)

Description

Return true if either this is an opaque pointer type or if this pointee type matches Ty. Primarily used for checking if an instruction's pointer operands are valid types. Will be useless after non-opaque pointers are removed.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:688

Parameters

llvm::Type* Ty

static bool isValidElementType(llvm::Type* ElemTy)

Description

Return true if the specified type is valid as a element type.

Declared at: llvm/include/llvm/IR/DerivedTypes.h:676

Parameters

llvm::Type* ElemTy