HLVM API Documentation

Bundle Class Reference

AST Bundle Node. More...

#include <Bundle.h>

Inheritance diagram for Bundle:

Inheritance graph
[legend]
List of all members.

Accessors

Public Types

Types

Public Member Functions

Mutators
Type Management
Iterators

Protected Member Functions

Constructors

Protected Attributes

Data

Friends


Detailed Description

AST Bundle Node.

This class is simply a collection of definitions. Things that can be defined in a bundle include types, global variables, functions, classes, etc. A bundle is the unit of linking and loading. A given compilation unit may define as many bundles as it desires. When a bundle is loaded, all of its definitions become active. Only those things defined in a bundle participate in linking A Bundle's parent is always the AST node. Each Bundle has a name and that name forms a namespace for the definitions within the bundle. Bundles cannot be nested.

Definition at line 103 of file Bundle.h.


Member Typedef Documentation

typedef ConstantList::const_iterator clist_const_iterator
 

Definition at line 118 of file Bundle.h.

typedef ConstantList::iterator clist_iterator
 

Definition at line 117 of file Bundle.h.

typedef std::vector<Constant*> ConstantList
 

Definition at line 116 of file Bundle.h.

typedef SymbolTable<Constant> ConstantTable
 

Definition at line 120 of file Bundle.h.

typedef ConstantTable::const_iterator ctable_const_iterator
 

Definition at line 122 of file Bundle.h.

typedef ConstantTable::iterator ctable_iterator
 

Definition at line 121 of file Bundle.h.

typedef TypeList::const_iterator tlist_const_iterator
 

Definition at line 110 of file Bundle.h.

typedef TypeList::iterator tlist_iterator
 

Definition at line 109 of file Bundle.h.

typedef TypeTable::const_iterator ttable_const_iterator
 

Definition at line 114 of file Bundle.h.

typedef TypeTable::iterator ttable_iterator
 

Definition at line 113 of file Bundle.h.

typedef std::vector<Type*> TypeList
 

Definition at line 108 of file Bundle.h.

typedef SymbolTable<Type> TypeTable
 

Definition at line 112 of file Bundle.h.


Constructor & Destructor Documentation

Bundle  )  [inline, protected]
 

Definition at line 128 of file Bundle.h.

~Bundle  )  [protected, virtual]
 

Definition at line 41 of file Bundle.cpp.


Member Function Documentation

static bool classof const Node N  )  [inline, static]
 

Provide support for isa<X> and friends.

Reimplemented from Documentable.

Definition at line 138 of file Bundle.h.

References hlvm::BundleID, and Node::is().

static bool classof const Bundle  )  [inline, static]
 

Definition at line 137 of file Bundle.h.

clist_const_iterator clist_begin  )  const [inline]
 

Definition at line 201 of file Bundle.h.

References Bundle::clist.

clist_iterator clist_begin  )  [inline]
 

Value Insertion Order Iteration.

Definition at line 200 of file Bundle.h.

References Bundle::clist.

bool clist_empty  )  const [inline]
 

Definition at line 205 of file Bundle.h.

References Bundle::clist.

clist_const_iterator clist_end  )  const [inline]
 

Definition at line 203 of file Bundle.h.

References Bundle::clist.

clist_iterator clist_end  )  [inline]
 

Definition at line 202 of file Bundle.h.

References Bundle::clist.

size_t clist_size  )  const [inline]
 

Definition at line 204 of file Bundle.h.

References Bundle::clist.

ctable_const_iterator ctable_begin  )  const [inline]
 

Definition at line 209 of file Bundle.h.

References SymbolTable::begin(), and Bundle::ctable.

ctable_iterator ctable_begin  )  [inline]
 

Value Symbol Table Iteration.

Definition at line 208 of file Bundle.h.

References SymbolTable::begin(), and Bundle::ctable.

bool ctable_empty  )  const [inline]
 

Definition at line 213 of file Bundle.h.

References Bundle::ctable, and SymbolTable::empty().

ctable_const_iterator ctable_end  )  const [inline]
 

Definition at line 211 of file Bundle.h.

References Bundle::ctable, and SymbolTable::end().

ctable_iterator ctable_end  )  [inline]
 

Definition at line 210 of file Bundle.h.

References Bundle::ctable, and SymbolTable::end().

size_t ctable_size  )  const [inline]
 

Definition at line 212 of file Bundle.h.

References Bundle::ctable, and SymbolTable::size().

Constant * getConst const std::string &  n  )  const
 

Get an existing constant by name or 0 if there is no such constant.

Definition at line 276 of file Bundle.cpp.

References Bundle::ctable, and SymbolTable::lookup().

void getIntrinsicName IntrinsicTypes  ty,
std::string &  name
 

Get the standard name of one of the primitive types.

Definition at line 169 of file Bundle.cpp.

References hlvm::boolTy, hlvm::bufferTy, hlvm::charTy, hlvm::doubleTy, hlvm::f128Ty, hlvm::f32Ty, hlvm::f44Ty, hlvm::f64Ty, hlvm::f80Ty, hlvm::f96Ty, hlvm::floatTy, hlvmDeadCode, hlvm::intTy, hlvm::longTy, hlvm::octetTy, hlvm::qs128Ty, hlvm::qs16Ty, hlvm::qs32Ty, hlvm::qs64Ty, hlvm::qu128Ty, hlvm::qu16Ty, hlvm::qu32Ty, hlvm::qu64Ty, hlvm::r16Ty, hlvm::r32Ty, hlvm::r64Ty, hlvm::r8Ty, hlvm::s128Ty, hlvm::s16Ty, hlvm::s32Ty, hlvm::s64Ty, hlvm::s8Ty, hlvm::shortTy, hlvm::streamTy, hlvm::stringTy, hlvm::textTy, hlvm::u128Ty, hlvm::u16Ty, hlvm::u32Ty, hlvm::u64Ty, hlvm::u8Ty, and hlvm::voidTy.

Type * getIntrinsicType const std::string &  name  ) 
 

Get one of the intrinsic types by its name.

Definition at line 235 of file Bundle.cpp.

References Bundle::getIntrinsicType(), Bundle::getIntrinsicTypesValue(), and hlvm::NoIntrinsicType.

Type * getIntrinsicType IntrinsicTypes  ty  ) 
 

Get one of the intrinsic types directly by its identifier.

Definition at line 222 of file Bundle.cpp.

References Bundle::getIntrinsicName(), Node::getRoot(), Bundle::getType(), Bundle::name, AST::new_IntrinsicType(), and Type::setIsIntrinsic().

IntrinsicTypes getIntrinsicTypesValue const std::string &  name  ) 
 

Get the Intrinsic Id from the intrinsic's name.

Definition at line 117 of file Bundle.cpp.

References hlvm::boolTy, hlvm::bufferTy, hlvm::charTy, hlvm::doubleTy, hlvm::f128Ty, hlvm::f32Ty, hlvm::f44Ty, hlvm::f64Ty, hlvm::f80Ty, hlvm::f96Ty, hlvm::floatTy, hlvm::intTy, hlvm::longTy, hlvm::NoIntrinsicType, hlvm::octetTy, hlvm::qs128Ty, hlvm::qs16Ty, hlvm::qs32Ty, hlvm::qs64Ty, hlvm::qu128Ty, hlvm::qu16Ty, hlvm::qu32Ty, hlvm::qu64Ty, hlvm::r16Ty, hlvm::r32Ty, hlvm::r64Ty, hlvm::r8Ty, hlvm::s128Ty, hlvm::s16Ty, hlvm::s32Ty, hlvm::s64Ty, hlvm::s8Ty, hlvm::shortTy, hlvm::streamTy, hlvm::stringTy, hlvm::textTy, hlvm::u128Ty, hlvm::u16Ty, hlvm::u32Ty, hlvm::u64Ty, hlvm::u8Ty, and hlvm::voidTy.

const std::string& getName  )  const [inline]
 

Definition at line 136 of file Bundle.h.

References Bundle::name.

Type * getOrCreateType const std::string &  name  ) 
 

Resolve a type name into a Type and allow for forward referencing.

Definition at line 265 of file Bundle.cpp.

References Node::getRoot(), Bundle::getType(), SymbolTable::insert(), AST::new_OpaqueType(), and Bundle::unresolvedTypes.

PointerType * getPointerTo const Type Ty  ) 
 

Get a standard pointer type to the element type Ty.

Definition at line 244 of file Bundle.cpp.

References Type::getName(), Node::getRoot(), Bundle::getType(), hlvmAssert, and AST::new_PointerType().

SignatureType * getProgramType  ) 
 

Return the type of a program, named ProgramType.

Definition at line 92 of file Bundle.cpp.

References SignatureType::addParameter(), ast, Bundle::getIntrinsicType(), Bundle::getPointerTo(), Node::getRoot(), Bundle::getType(), hlvmAssert, AST::new_Parameter(), AST::new_SignatureType(), hlvm::s32Ty, Type::setIsIntrinsic(), and hlvm::stringTy.

Type * getType const std::string &  n  ) 
 

Get an existing type by name or 0 if there is no such type.

Definition at line 255 of file Bundle.cpp.

References SymbolTable::lookup(), Bundle::ttable, and Bundle::unresolvedTypes.

void insertChild Node kid  )  [virtual]
 

Reimplemented from Node.

Definition at line 44 of file Bundle.cpp.

References Bundle::clist_begin(), Bundle::clist_end(), SymbolTable::erase(), hlvmAssert, SymbolTable::lookup(), Bundle::tlist_begin(), Bundle::tlist_end(), and Bundle::unresolvedTypes.

void removeChild Node kid  )  [virtual]
 

Reimplemented from Node.

Definition at line 75 of file Bundle.cpp.

References SymbolTable::erase(), hlvmAssert, Bundle::tlist, Bundle::tlist_begin(), Bundle::tlist_end(), and Bundle::ttable.

void setName const std::string &  n  )  [inline]
 

Definition at line 144 of file Bundle.h.

References Bundle::name.

tlist_const_iterator tlist_begin  )  const [inline]
 

Definition at line 185 of file Bundle.h.

References Bundle::tlist.

tlist_iterator tlist_begin  )  [inline]
 

Definition at line 184 of file Bundle.h.

References Bundle::tlist.

bool tlist_empty  )  const [inline]
 

Definition at line 189 of file Bundle.h.

References Bundle::tlist.

tlist_const_iterator tlist_end  )  const [inline]
 

Definition at line 187 of file Bundle.h.

References Bundle::tlist.

tlist_iterator tlist_end  )  [inline]
 

Definition at line 186 of file Bundle.h.

References Bundle::tlist.

size_t tlist_size  )  const [inline]
 

Definition at line 188 of file Bundle.h.

References Bundle::tlist.

ttable_const_iterator ttable_begin  )  const [inline]
 

Definition at line 193 of file Bundle.h.

References SymbolTable::begin(), and Bundle::ttable.

ttable_iterator ttable_begin  )  [inline]
 

Type Symbol Table Iteration.

Definition at line 192 of file Bundle.h.

References SymbolTable::begin(), and Bundle::ttable.

bool ttable_empty  )  const [inline]
 

Definition at line 197 of file Bundle.h.

References SymbolTable::empty(), and Bundle::ttable.

ttable_const_iterator ttable_end  )  const [inline]
 

Definition at line 195 of file Bundle.h.

References SymbolTable::end(), and Bundle::ttable.

ttable_iterator ttable_end  )  [inline]
 

Definition at line 194 of file Bundle.h.

References SymbolTable::end(), and Bundle::ttable.

size_t ttable_size  )  const [inline]
 

Definition at line 196 of file Bundle.h.

References SymbolTable::size(), and Bundle::ttable.


Friends And Related Function Documentation

friend class AST [friend]
 

Reimplemented from Documentable.

Definition at line 227 of file Bundle.h.


Member Data Documentation

ConstantList clist [protected]
 

The list of values in insertion order.

Definition at line 223 of file Bundle.h.

ConstantTable ctable [protected]
 

Definition at line 224 of file Bundle.h.

std::string name [protected]
 

The name for this bundle.

Definition at line 219 of file Bundle.h.

TypeList tlist [protected]
 

The list of types.

Definition at line 220 of file Bundle.h.

TypeTable ttable [protected]
 

The list of types.

Definition at line 221 of file Bundle.h.

TypeTable unresolvedTypes [protected]
 

The list of forward referenced types.

Definition at line 222 of file Bundle.h.


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