LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 183 of file DerivedTypes.h.


Member Typedef Documentation

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

Definition at line 204 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 390 of file Type.cpp.

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


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 227 of file DerivedTypes.h.

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

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

Definition at line 226 of file DerivedTypes.h.

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

Definition at line 205 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by calcTypeName(), and getTypeDescription().

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

Definition at line 206 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by calcTypeName(), and getTypeDescription().

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

References llvm::TypeMap< ValType, TypeClass >::add(), and llvm::TypeMap< ValType, TypeClass >::get().

Referenced by llvm::ConstantStruct::get(), llvm::AllocInfo::getConstantType(), llvm::ProgramInfo::getSourceFiles(), llvm::ProgramInfo::getSourceFunctions(), and llvm::BytecodeReader::ParseType().

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

Definition at line 210 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by llvm::ConstantStruct::ConstantStruct(), llvm::StructValType::get(), llvm::DSNode::mergeTypeInfo(), llvm::BytecodeReader::ParseConstantValue(), and TypesEqual().

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

Definition at line 209 of file DerivedTypes.h.

References llvm::Type::ContainedTys.

Referenced by llvm::ConstantStruct::ConstantStruct(), llvm::StructValType::get(), llvm::StructValType::hashTypeStructure(), llvm::BytecodeReader::ParseConstantValue(), 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 317 of file Type.cpp.

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

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

Implements llvm::CompositeType.

Definition at line 306 of file Type.cpp.

References llvm::Type::ContainedTys, llvm::Value::getType(), and llvm::Type::UIntTy.

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.

Implements llvm::AbstractTypeUser.

Definition at line 1268 of file Type.cpp.

References llvm::TypeMap< ValType, TypeClass >::finishRefinement().

Referenced by typeBecameConcrete().

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.

Implements llvm::AbstractTypeUser.

Definition at line 1273 of file Type.cpp.

References refineAbstractType().


Friends And Related Function Documentation

friend class TypeMap< StructValType, StructType > [friend]
 

Definition at line 184 of file DerivedTypes.h.


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