LLVM API Documentation

llvm::StructType Class Reference

#include <DerivedTypes.h>

Inheritance diagram for llvm::StructType:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< PATypeHandle
>::const_iterator 
element_iterator

Public Member Functions

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

Static Public Member Functions

static StructTypeget (const std::vector< const Type * > &Params)
static bool classof (const StructType *T)
static bool classof (const Type *T)
 Methods for support type inquiry through isa, cast, and dyn_cast:.

Protected Member Functions

 StructType (const std::vector< const Type * > &Types)

Friends

class TypeMap< StructValType, StructType >

Detailed Description

StructType - Class to represent struct types

Definition at line 154 of file DerivedTypes.h.


Member Typedef Documentation

typedef std::vector<PATypeHandle>::const_iterator llvm::StructType::element_iterator

Definition at line 175 of file DerivedTypes.h.


Constructor & Destructor Documentation

StructType::StructType ( const std::vector< const Type * > &  Types  )  [protected]

This should really be private, but it squelches a bogus warning from GCC to make them protected: warning: `class StructType' only defines private constructors and has no friends

Private ctor - Only can be created by a static member...

Definition at line 430 of file Type.cpp.

References llvm::Type::ContainedTys, llvm::Type::isAbstract(), llvm::Type::setAbstract(), and llvm::Type::VoidTy.


Member Function Documentation

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

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

Reimplemented from llvm::CompositeType.

Definition at line 198 of file DerivedTypes.h.

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

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

Definition at line 197 of file DerivedTypes.h.

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

Definition at line 176 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by calcTypeName(), getTypeDescription(), and llvm::DSNode::mergeTypeInfo().

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

Definition at line 177 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by calcTypeName(), getTypeDescription(), and llvm::DSNode::mergeTypeInfo().

StructType * StructType::get ( const std::vector< const Type * > &  Params  )  [static]

StructType::get - This static method is the primary way to create a StructType.

Definition at line 1143 of file Type.cpp.

References StructTypes.

Referenced by llvm::ConstantStruct::get(), llvm::AllocInfo::getConstantType(), llvm::DISerializer::getEmptyStructPtrType(), llvm::ProgramInfo::getSourceFiles(), llvm::ProgramInfo::getSourceFunctions(), llvm::DISerializer::getTagType(), llvm::DSNode::mergeTypeInfo(), and llvm::BytecodeReader::ParseType().

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

Definition at line 181 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by EvaluateStoreInto(), llvm::StructValType::get(), llvm::DSNode::mergeTypeInfo(), llvm::BytecodeReader::ParseConstantPoolValue(), and TypesEqual().

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

Definition at line 180 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by EvaluateStoreInto(), llvm::StructValType::get(), llvm::StructValType::hashTypeStructure(), llvm::BytecodeReader::ParseConstantPoolValue(), and TypesEqual().

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 357 of file Type.cpp.

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

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

Implements llvm::CompositeType.

Definition at line 346 of file Type.cpp.

References llvm::Type::ContainedTys, llvm::Type::UIntTy, and V.

Referenced by getTypeAtIndex().

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 1382 of file Type.cpp.

References 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 1387 of file Type.cpp.

References StructTypes.


Friends And Related Function Documentation

friend class TypeMap< StructValType, StructType > [friend]

Definition at line 155 of file DerivedTypes.h.


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