LLVM API Documentation

llvm::StructType Class Reference

#include <DerivedTypes.h>

Inheritance diagram for llvm::StructType:
[legend]
Collaboration diagram for llvm::StructType:
[legend]

List of all members.

Public Types

typedef Type::subtype_iterator element_iterator

Public Member Functions

element_iterator element_begin () const
element_iterator element_end () const
unsigned getNumElements () const
const Type * getElementType (unsigned N) const
virtual const Type * getTypeAtIndex (const Value *V) const
virtual const Type * getTypeAtIndex (unsigned Idx) const
virtual bool indexValid (const Value *V) const
virtual bool indexValid (unsigned Idx) const
virtual void refineAbstractType (const DerivedType *OldTy, const Type *NewTy)
virtual void typeBecameConcrete (const DerivedType *AbsTy)
bool isPacked () const

Static Public Member Functions

static StructType * get (LLVMContext &Context, const std::vector< const Type * > &Params, bool isPacked=false)
static StructType * get (LLVMContext &Context, bool isPacked=false)
static StructType * get (LLVMContext &Context, const Type *type,...) END_WITH_NULL
static bool isValidElementType (const Type *ElemTy)
static bool classof (const StructType *)
static bool classof (const Type *T)
 Methods for support type inquiry through isa, cast, and dyn_cast:.

Friends

class TypeMap< StructValType, StructType >


Detailed Description

StructType - Class to represent struct types

Definition at line 239 of file DerivedTypes.h.


Member Typedef Documentation

Definition at line 271 of file DerivedTypes.h.


Member Function Documentation

StructType * StructType::get ( LLVMContext &  Context,
const std::vector< const Type * > &  Params,
bool  isPacked = false 
) [static]

static StructType* llvm::StructType::get ( LLVMContext &  Context,
bool  isPacked = false 
) [inline, static]

StructType::get - Create an empty structure type.

Definition at line 255 of file DerivedTypes.h.

References Context.

StructType * StructType::get ( LLVMContext &  Context,
const Type *  type,
  ... 
) [static]

StructType::get - This static method is a convenience method for creating structure types by specifying the elements as arguments. Note that this method always returns a non-packed struct. To get an empty struct, pass NULL, NULL.

Definition at line 899 of file Type.cpp.

References get().

bool StructType::isValidElementType ( const Type *  ElemTy  )  [static]

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

Definition at line 910 of file Type.cpp.

References llvm::Type::getContext(), llvm::Type::getLabelTy(), llvm::Type::getMetadataTy(), and llvm::Type::getVoidTy().

element_iterator llvm::StructType::element_begin (  )  const [inline]

Definition at line 272 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by LLVMGetStructElementTypes(), and WriteTypeTable().

element_iterator llvm::StructType::element_end (  )  const [inline]

unsigned llvm::StructType::getNumElements (  )  const [inline]

const Type* llvm::StructType::getElementType ( unsigned  N  )  const [inline]

const Type * StructType::getTypeAtIndex ( const Value *  V  )  const [virtual]

getTypeAtIndex - Given an index value into the type, return the type of the element. For a structure type, this must be a constant value...

Implements llvm::CompositeType.

Definition at line 292 of file Type.cpp.

References Idx.

const Type * StructType::getTypeAtIndex ( unsigned  Idx  )  const [virtual]

Implements llvm::CompositeType.

Definition at line 297 of file Type.cpp.

References llvm::Type::ContainedTys, and indexValid().

bool StructType::indexValid ( const Value *  V  )  const [virtual]

Implements llvm::CompositeType.

Definition at line 277 of file Type.cpp.

References llvm::Value::getContext(), llvm::Type::getInt32Ty(), and llvm::Value::getType().

Referenced by getTypeAtIndex().

bool StructType::indexValid ( unsigned  Idx  )  const [virtual]

Implements llvm::CompositeType.

Definition at line 285 of file Type.cpp.

void StructType::refineAbstractType ( const DerivedType *  OldTy,
const Type *  NewTy 
) [virtual]

refineAbstractType - The callback method invoked when an abstract type is resolved to another type. An object must override this method to update its internal state to reference NewType instead of OldType.

Reimplemented from llvm::Type.

Definition at line 1178 of file Type.cpp.

References llvm::Type::getContext(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::StructTypes.

void StructType::typeBecameConcrete ( const DerivedType *  AbsTy  )  [virtual]

The other case which AbstractTypeUsers must be aware of is when a type makes the transition from being abstract (where it has clients on it's AbstractTypeUsers list) to concrete (where it does not). This method notifies ATU's when this occurs for a type.

Reimplemented from llvm::Type.

Definition at line 1184 of file Type.cpp.

References llvm::Type::getContext(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::StructTypes.

static bool llvm::StructType::classof ( const StructType *   )  [inline, static]

Definition at line 295 of file DerivedTypes.h.

static bool llvm::StructType::classof ( const Type *   )  [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:.

Reimplemented from llvm::CompositeType.

Definition at line 296 of file DerivedTypes.h.

References llvm::Type::getTypeID(), and llvm::Type::StructTyID.

bool llvm::StructType::isPacked (  )  const [inline]


Friends And Related Function Documentation

friend class TypeMap< StructValType, StructType > [friend]

Definition at line 240 of file DerivedTypes.h.


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