LLVM API Documentation

llvm::Module Class Reference

The main container class for the LLVM Intermediate Representation. More...

#include <Module.h>

Collaboration diagram for llvm::Module:
[legend]

List of all members.

Member Variables

class Constant

Direct access to the globals list, functions list, and symbol table

const GlobalListType & getGlobalList () const
 Get the Module's list of global variables (constant).
GlobalListType & getGlobalList ()
 Get the Module's list of global variables.
const FunctionListType & getFunctionList () const
 Get the Module's list of functions (constant).
FunctionListType & getFunctionList ()
 Get the Module's list of functions.
const AliasListType & getAliasList () const
 Get the Module's list of aliases (constant).
AliasListType & getAliasList ()
 Get the Module's list of aliases.
const NamedMDListType & getNamedMDList () const
 Get the Module's list of named metadata (constant).
NamedMDListType & getNamedMDList ()
 Get the Module's list of named metadata.
const ValueSymbolTable & getValueSymbolTable () const
 Get the symbol table of global variable and function identifiers.
ValueSymbolTable & getValueSymbolTable ()
 Get the Module's symbol table of global variable and function identifiers.
const TypeSymbolTable & getTypeSymbolTable () const
 Get the symbol table of types.
TypeSymbolTable & getTypeSymbolTable ()
 Get the Module's symbol table of types.
static iplist< GlobalVariable >
Module::* 
getSublistAccess (GlobalVariable *)
static iplist< Function > Module::* getSublistAccess (Function *)
static iplist< GlobalAlias >
Module::* 
getSublistAccess (GlobalAlias *)
static iplist< NamedMDNode >
Module::* 
getSublistAccess (NamedMDNode *)

Public Types

Types And Enumerations
enum  Endianness { AnyEndianness, LittleEndian, BigEndian }
 An enumeration for describing the endianess of the target machine. More...
enum  PointerSize { AnyPointerSize, Pointer32, Pointer64 }
 An enumeration for describing the size of a pointer on the target machine. More...
typedef iplist< GlobalVariable > GlobalListType
 The type for the list of global variables.
typedef iplist< Function > FunctionListType
 The type for the list of functions.
typedef iplist< GlobalAlias > AliasListType
 The type for the list of aliases.
typedef iplist< NamedMDNode > NamedMDListType
 The type for the list of named metadata.
typedef std::vector< std::string > LibraryListType
 The type for the list of dependent libraries.
typedef GlobalListType::iterator global_iterator
 The Global Variable iterator.
typedef
GlobalListType::const_iterator 
const_global_iterator
 The Global Variable constant iterator.
typedef FunctionListType::iterator iterator
 The Function iterators.
typedef
FunctionListType::const_iterator 
const_iterator
 The Function constant iterator.
typedef AliasListType::iterator alias_iterator
 The Global Alias iterators.
typedef
AliasListType::const_iterator 
const_alias_iterator
 The Global Alias constant iterator.
typedef NamedMDListType::iterator named_metadata_iterator
 The named metadata iterators.
typedef
NamedMDListType::const_iterator 
const_named_metadata_iterator
 The named metadata constant interators.
typedef
LibraryListType::const_iterator 
lib_iterator
 The Library list iterator.

Public Member Functions

Constructors
 Module (const StringRef &ModuleID, LLVMContext &C)
 ~Module ()
 The module destructor. This will dropAllReferences.
Module Level Accessors
const std::string & getModuleIdentifier () const
const std::string & getDataLayout () const
const std::string & getTargetTriple () const
Endianness getEndianness () const
 Target endian information...
PointerSize getPointerSize () const
 Target Pointer Size information...
LLVMContext & getContext () const
const std::string & getModuleInlineAsm () const
Module Level Mutators
void setModuleIdentifier (const StringRef &ID)
 Set the module identifier.
void setDataLayout (const StringRef &DL)
 Set the data layout.
void setTargetTriple (const StringRef &T)
 Set the target triple.
void setModuleInlineAsm (const StringRef &Asm)
 Set the module-scope inline assembly blocks.
void appendModuleInlineAsm (const StringRef &Asm)
Generic Value Accessors
GlobalValue * getNamedValue (const StringRef &Name) const
Function Accessors
Constant * getOrInsertFunction (const StringRef &Name, const FunctionType *T, AttrListPtr AttributeList)
Constant * getOrInsertFunction (const StringRef &Name, const FunctionType *T)
Constant * getOrInsertFunction (const StringRef &Name, AttrListPtr AttributeList, const Type *RetTy,...) END_WITH_NULL
Constant * getOrInsertFunction (const StringRef &Name, const Type *RetTy,...) END_WITH_NULL
Constant * getOrInsertTargetIntrinsic (const StringRef &Name, const FunctionType *Ty, AttrListPtr AttributeList)
Function * getFunction (const StringRef &Name) const
Global Variable Accessors
GlobalVariable * getGlobalVariable (const StringRef &Name, bool AllowInternal=false) const
GlobalVariable * getNamedGlobal (const StringRef &Name) const
Constant * getOrInsertGlobal (const StringRef &Name, const Type *Ty)
Global Alias Accessors
GlobalAlias * getNamedAlias (const StringRef &Name) const
Named Metadata Accessors
NamedMDNode * getNamedMetadata (const StringRef &Name) const
NamedMDNode * getOrInsertNamedMetadata (const StringRef &Name)
Type Accessors
bool addTypeName (const StringRef &Name, const Type *Ty)
std::string getTypeName (const Type *Ty) const
const Type * getTypeByName (const StringRef &Name) const
Global Variable Iteration
global_iterator global_begin ()
 Get an iterator to the first global variable.
const_global_iterator global_begin () const
 Get a constant iterator to the first global variable.
global_iterator global_end ()
 Get an iterator to the last global variable.
const_global_iterator global_end () const
 Get a constant iterator to the last global variable.
bool global_empty () const
 Determine if the list of globals is empty.
Function Iteration
iterator begin ()
 Get an iterator to the first function.
const_iterator begin () const
 Get a constant iterator to the first function.
iterator end ()
 Get an iterator to the last function.
const_iterator end () const
 Get a constant iterator to the last function.
size_t size () const
 Determine how many functions are in the Module's list of functions.
bool empty () const
 Determine if the list of functions is empty.
Dependent Library Iteration
lib_iterator lib_begin () const
 Get a constant iterator to beginning of dependent library list.
lib_iterator lib_end () const
 Get a constant iterator to end of dependent library list.
size_t lib_size () const
 Returns the number of items in the list of libraries.
void addLibrary (const StringRef &Lib)
 Add a library to the list of dependent libraries.
void removeLibrary (const StringRef &Lib)
 Remove a library from the list of dependent libraries.
const LibraryListType & getLibraries () const
 Get all the libraries.
Alias Iteration
alias_iterator alias_begin ()
 Get an iterator to the first alias.
const_alias_iterator alias_begin () const
 Get a constant iterator to the first alias.
alias_iterator alias_end ()
 Get an iterator to the last alias.
const_alias_iterator alias_end () const
 Get a constant iterator to the last alias.
size_t alias_size () const
 Determine how many aliases are in the Module's list of aliases.
bool alias_empty () const
 Determine if the list of aliases is empty.
Named Metadata Iteration
named_metadata_iterator named_metadata_begin ()
 Get an iterator to the first named metadata.
const_named_metadata_iterator named_metadata_begin () const
 Get a constant iterator to the first named metadata.
named_metadata_iterator named_metadata_end ()
 Get an iterator to the last named metadata.
const_named_metadata_iterator named_metadata_end () const
 Get a constant iterator to the last named metadata.
size_t named_metadata_size () const
 Determine how many NamedMDNodes are in the Module's list of named metadata.
bool named_metadata_empty () const
 Determine if the list of named metadata is empty.
Utility functions for printing and dumping Module objects
void print (raw_ostream &OS, AssemblyAnnotationWriter *AAW) const
 Print the module to an output stream with AssemblyAnnotationWriter.
void print (std::ostream &OS, AssemblyAnnotationWriter *AAW) const
void dump () const
 Dump the module to stderr (for debugging).
void dropAllReferences ()


Detailed Description

The main container class for the LLVM Intermediate Representation.

A Module instance is used to store all the information related to an LLVM module. Modules are the top level container of all other LLVM Intermediate Representation (IR) objects. Each module directly contains a list of globals variables, a list of functions, a list of libraries (or other modules) this module depends on, a symbol table, and various data about the target's characteristics.

A module maintains a GlobalValRefMap object that is used to hold all constant references to global variables in the module. When a global variable is destroyed, it should have no entries in the GlobalValueRefMap.

Definition at line 87 of file Module.h.


Member Typedef Documentation

The type for the list of global variables.

Definition at line 92 of file Module.h.

The type for the list of functions.

Definition at line 94 of file Module.h.

The type for the list of aliases.

Definition at line 96 of file Module.h.

The type for the list of named metadata.

Definition at line 98 of file Module.h.

typedef std::vector<std::string> llvm::Module::LibraryListType

The type for the list of dependent libraries.

Definition at line 101 of file Module.h.

typedef GlobalListType::iterator llvm::Module::global_iterator

The Global Variable iterator.

Definition at line 104 of file Module.h.

typedef GlobalListType::const_iterator llvm::Module::const_global_iterator

The Global Variable constant iterator.

Definition at line 106 of file Module.h.

typedef FunctionListType::iterator llvm::Module::iterator

The Function iterators.

Definition at line 109 of file Module.h.

typedef FunctionListType::const_iterator llvm::Module::const_iterator

The Function constant iterator.

Definition at line 111 of file Module.h.

typedef AliasListType::iterator llvm::Module::alias_iterator

The Global Alias iterators.

Definition at line 114 of file Module.h.

typedef AliasListType::const_iterator llvm::Module::const_alias_iterator

The Global Alias constant iterator.

Definition at line 116 of file Module.h.

typedef NamedMDListType::iterator llvm::Module::named_metadata_iterator

The named metadata iterators.

Definition at line 119 of file Module.h.

typedef NamedMDListType::const_iterator llvm::Module::const_named_metadata_iterator

The named metadata constant interators.

Definition at line 121 of file Module.h.

typedef LibraryListType::const_iterator llvm::Module::lib_iterator

The Library list iterator.

Definition at line 123 of file Module.h.


Member Enumeration Documentation

An enumeration for describing the endianess of the target machine.

Enumerator:
AnyEndianness 
LittleEndian 
BigEndian 

Definition at line 126 of file Module.h.

An enumeration for describing the size of a pointer on the target machine.

Enumerator:
AnyPointerSize 
Pointer32 
Pointer64 

Definition at line 129 of file Module.h.


Constructor & Destructor Documentation

Module::Module ( const StringRef &  ModuleID,
LLVMContext &  C 
) [explicit]

The Module constructor. Note that there is no default constructor. You must provide a name for the module upon construction.

Definition at line 59 of file Module.cpp.

Module::~Module (  ) 

The module destructor. This will dropAllReferences.

Definition at line 65 of file Module.cpp.

References dropAllReferences().


Member Function Documentation

const std::string& llvm::Module::getModuleIdentifier (  )  const [inline]

const std::string& llvm::Module::getDataLayout (  )  const [inline]

Get the data layout string for the module's target platform. This encodes the type sizes and alignments expected by this module.

Returns:
the data layout as a string

Definition at line 172 of file Module.h.

Referenced by llvm::CloneModule(), llvm::Linker::LinkModules(), llvm::TargetData::TargetData(), and WriteModuleInfo().

const std::string& llvm::Module::getTargetTriple (  )  const [inline]

Get the target triple which is a string describing the target host.

Returns:
a string containing the target triple.

Definition at line 176 of file Module.h.

Referenced by llvm::CloneModule(), llvm::Linker::LinkModules(), llvm::JIT::selectTarget(), llvm::WriteBitcodeToStream(), and WriteModuleInfo().

Module::Endianness Module::getEndianness (  )  const

Target endian information...

Get the target endian information.

Returns:
Endianess - an enumeration for the endianess of the target

Definition at line 77 of file Module.cpp.

References AnyEndianness, BigEndian, llvm::getToken(), and LittleEndian.

Referenced by llvm::Linker::LinkModules().

Module::PointerSize Module::getPointerSize (  )  const

Target Pointer Size information...

Get the target pointer size.

Returns:
PointerSize - an enumeration for the size of the target's pointer

Definition at line 95 of file Module.cpp.

References AnyPointerSize, llvm::getToken(), Pointer32, Pointer64, and size().

Referenced by llvm::Linker::LinkModules(), llvm::MSILWriter::printConvToPtr(), and llvm::MSILWriter::printPtrLoad().

LLVMContext& llvm::Module::getContext (  )  const [inline]

const std::string& llvm::Module::getModuleInlineAsm (  )  const [inline]

Get any module-scope inline assembly blocks.

Returns:
a string containing the module-scope inline assembly blocks.

Definition at line 192 of file Module.h.

Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), llvm::Linker::LinkModules(), and WriteModuleInfo().

void llvm::Module::setModuleIdentifier ( const StringRef &  ID  )  [inline]

Set the module identifier.

Definition at line 199 of file Module.h.

void llvm::Module::setDataLayout ( const StringRef &  DL  )  [inline]

Set the data layout.

Definition at line 202 of file Module.h.

Referenced by llvm::CloneModule(), and llvm::Linker::LinkModules().

void llvm::Module::setTargetTriple ( const StringRef &  T  )  [inline]

Set the target triple.

Definition at line 205 of file Module.h.

Referenced by llvm::CloneModule(), and llvm::Linker::LinkModules().

void llvm::Module::setModuleInlineAsm ( const StringRef &  Asm  )  [inline]

Set the module-scope inline assembly blocks.

Definition at line 208 of file Module.h.

Referenced by llvm::CloneModule(), and llvm::Linker::LinkModules().

void llvm::Module::appendModuleInlineAsm ( const StringRef &  Asm  )  [inline]

Append to the module-scope inline assembly blocks, automatically appending a newline to the end.

Definition at line 212 of file Module.h.

GlobalValue * Module::getNamedValue ( const StringRef &  Name  )  const

getNamedValue - Return the first global value in the module with the specified name, of arbitrary type. This method returns null if a global with the specified name is not found.

getNamedValue - Return the first global value in the module with the specified name, of arbitrary type. This method returns null if a global with the specified name is not found.

Definition at line 118 of file Module.cpp.

References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().

Referenced by getFunction(), getGlobalVariable(), getNamedAlias(), getOrInsertFunction(), getOrInsertGlobal(), and getOrInsertTargetIntrinsic().

Constant * Module::getOrInsertFunction ( const StringRef &  Name,
const FunctionType *  T,
AttrListPtr  AttributeList 
)

getOrInsertFunction - Look up the specified function in the module symbol table. Four possibilities: 1. If it does not exist, add a prototype for the function and return it. 2. If it exists, and has a local linkage, the existing function is renamed and a new one is inserted. 3. Otherwise, if the existing function has the correct prototype, return the existing function. 4. Finally, the function exists but has the wrong prototype: return the function with a constantexpr cast to the right prototype.

Definition at line 131 of file Module.cpp.

References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F, llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::GlobalValue::getType(), llvm::PointerType::getUnqual(), llvm::GlobalValue::hasLocalLinkage(), llvm::Function::isIntrinsic(), llvm::Function::setAttributes(), and llvm::Value::setName().

Referenced by llvm::IntrinsicLowering::AddPrototypes(), EnsureFunctionExists(), llvm::Intrinsic::getDeclaration(), getOrInsertFunction(), llvm::InsertProfilingInitCall(), ReplaceCallWith(), and UpgradeIntrinsicFunction1().

Constant * Module::getOrInsertFunction ( const StringRef &  Name,
const FunctionType *  T 
)

Definition at line 181 of file Module.cpp.

References llvm::AttrListPtr::get(), and getOrInsertFunction().

Constant * Module::getOrInsertFunction ( const StringRef &  Name,
AttrListPtr  AttributeList,
const Type *  RetTy,
  ... 
)

getOrInsertFunction - Look up the specified function in the module symbol table. If it does not exist, add a prototype for the function and return it. This function guarantees to return a constant of pointer to the specified function type or a ConstantExpr BitCast of that type if the named function has a different type. This version of the method takes a null terminated list of function arguments, which makes it easier for clients to use.

Definition at line 192 of file Module.cpp.

References llvm::FunctionType::get(), and getOrInsertFunction().

Constant * Module::getOrInsertFunction ( const StringRef &  Name,
const Type *  RetTy,
  ... 
)

Constant * Module::getOrInsertTargetIntrinsic ( const StringRef &  Name,
const FunctionType *  Ty,
AttrListPtr  AttributeList 
)

Function * Module::getFunction ( const StringRef &  Name  )  const

getFunction - Look up the specified function in the module symbol table. If it does not exist, return null.

Definition at line 232 of file Module.cpp.

References getNamedValue().

Referenced by llvm::AsmPrinter::doFinalization(), llvm::PointerTracking::doInitialization(), GetAllUndefinedSymbols(), LinkAlias(), llvm::MSILWriter::printModuleStartup(), and StripDebugInfo().

GlobalVariable * Module::getGlobalVariable ( const StringRef &  Name,
bool  AllowLocal = false 
) const

getGlobalVariable - Look up the specified global variable in the module symbol table. If it does not exist, return null. If AllowInternal is set to true, this function will return types that have InternalLinkage. By default, these types are not returned.

getGlobalVariable - Look up the specified global variable in the module symbol table. If it does not exist, return null. The type argument should be the underlying type of the global, i.e., it should not have the top-level PointerType, which represents the address of the global. If AllowLocal is set to true, this function will return types that have an local. By default, these types are not returned.

Definition at line 247 of file Module.cpp.

References getNamedValue().

Referenced by llvm::MachineModuleInfo::AnalyzeModule(), getNamedGlobal(), llvm::ProgramInfo::getSourceFiles(), llvm::ProgramInfo::getSourceFunctions(), LinkAlias(), StripDebugInfo(), and StripSymbolNames().

GlobalVariable* llvm::Module::getNamedGlobal ( const StringRef &  Name  )  const [inline]

getNamedGlobal - Return the first global variable in the module with the specified name, of arbitrary type. This method returns null if a global with the specified name is not found.

Definition at line 280 of file Module.h.

References getGlobalVariable().

Referenced by llvm::ExecutionEngine::runStaticConstructorsDestructors(), and StripDebugInfo().

Constant * Module::getOrInsertGlobal ( const StringRef &  Name,
const Type *  Ty 
)

getOrInsertGlobal - Look up the specified global in the module symbol table. 1. If it does not exist, add a declaration of the global and return it. 2. Else, the global exists but has the wrong type: return the function with a constantexpr cast to the right type. 3. Finally, if the existing global is the correct delclaration, return the existing global.

getOrInsertGlobal - Look up the specified global in the module symbol table. 1. If it does not exist, add a declaration of the global and return it. 2. Else, the global exists but has the wrong type: return the function with a constantexpr cast to the right type. 3. Finally, if the existing global is the correct delclaration, return the existing global.

Definition at line 262 of file Module.cpp.

References llvm::GlobalValue::ExternalLinkage, llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::GlobalValue::getType(), llvm::PointerType::getUnqual(), and GV.

GlobalAlias * Module::getNamedAlias ( const StringRef &  Name  )  const

getNamedAlias - Return the first global alias in the module with the specified name, of arbitrary type. This method returns null if a global with the specified name is not found.

Definition at line 289 of file Module.cpp.

References getNamedValue().

Referenced by LinkAlias().

NamedMDNode * Module::getNamedMetadata ( const StringRef &  Name  )  const

getNamedMetadata - Return the first NamedMDNode in the module with the specified name. This method returns null if a NamedMDNode with the specified name is not found.

getNamedMetadata - Return the first NamedMDNode in the module with the specified name. This method returns null if a NamedMDNode with the

Definition at line 296 of file Module.cpp.

References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().

Referenced by LinkNamedMDNodes().

NamedMDNode * Module::getOrInsertNamedMetadata ( const StringRef &  Name  ) 

getOrInsertNamedMetadata - Return the first named MDNode in the module with the specified name. This method returns a new NamedMDNode if a NamedMDNode with the specified name is not found.

getOrInsertNamedMetadata - Return the first named MDNode in the module with the specified name. This method returns a new NamedMDNode if a NamedMDNode with the specified name is not found.

Definition at line 303 of file Module.cpp.

References llvm::NamedMDNode::Create(), getContext(), getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().

bool Module::addTypeName ( const StringRef &  Name,
const Type *  Ty 
)

std::string Module::getTypeName ( const Type *  Ty  )  const

getTypeName - If there is at least one entry in the symbol table for the specified type, return it.

Definition at line 342 of file Module.cpp.

References llvm::TypeSymbolTable::begin(), llvm::TypeSymbolTable::end(), and getTypeSymbolTable().

Referenced by llvm::MSILWriter::getTypeName().

const Type * Module::getTypeByName ( const StringRef &  Name  )  const

getTypeByName - Return the type with the specified name in this module, or null if there is none by that name.

getTypeByName - Return the type with the specified name in this module, or null if there is none by that name.

Definition at line 334 of file Module.cpp.

References getTypeSymbolTable(), and llvm::TypeSymbolTable::lookup().

Referenced by llvm::findDbgGlobalDeclare().

const GlobalListType& llvm::Module::getGlobalList (  )  const [inline]

GlobalListType& llvm::Module::getGlobalList (  )  [inline]

Get the Module's list of global variables.

Definition at line 340 of file Module.h.

static iplist<GlobalVariable> Module::* llvm::Module::getSublistAccess ( GlobalVariable *   )  [inline, static]

Definition at line 341 of file Module.h.

const FunctionListType& llvm::Module::getFunctionList (  )  const [inline]

FunctionListType& llvm::Module::getFunctionList (  )  [inline]

Get the Module's list of functions.

Definition at line 347 of file Module.h.

static iplist<Function> Module::* llvm::Module::getSublistAccess ( Function *   )  [inline, static]

Definition at line 348 of file Module.h.

const AliasListType& llvm::Module::getAliasList (  )  const [inline]

Get the Module's list of aliases (constant).

Definition at line 352 of file Module.h.

Referenced by llvm::GlobalAlias::eraseFromParent(), llvm::GlobalAlias::GlobalAlias(), and llvm::GlobalAlias::removeFromParent().

AliasListType& llvm::Module::getAliasList (  )  [inline]

Get the Module's list of aliases.

Definition at line 354 of file Module.h.

static iplist<GlobalAlias> Module::* llvm::Module::getSublistAccess ( GlobalAlias *   )  [inline, static]

Definition at line 355 of file Module.h.

const NamedMDListType& llvm::Module::getNamedMDList (  )  const [inline]

Get the Module's list of named metadata (constant).

Definition at line 359 of file Module.h.

Referenced by llvm::NamedMDNode::eraseFromParent(), and llvm::NamedMDNode::NamedMDNode().

NamedMDListType& llvm::Module::getNamedMDList (  )  [inline]

Get the Module's list of named metadata.

Definition at line 361 of file Module.h.

static iplist<NamedMDNode> Module::* llvm::Module::getSublistAccess ( NamedMDNode *   )  [inline, static]

Definition at line 362 of file Module.h.

const ValueSymbolTable& llvm::Module::getValueSymbolTable (  )  const [inline]

Get the symbol table of global variable and function identifiers.

Definition at line 366 of file Module.h.

Referenced by ForceRenaming(), getNamedMetadata(), getNamedValue(), getOrInsertNamedMetadata(), LinkFunctionProtos(), LinkGlobals(), llvm::ValueEnumerator::ValueEnumerator(), and WriteModule().

ValueSymbolTable& llvm::Module::getValueSymbolTable (  )  [inline]

Get the Module's symbol table of global variable and function identifiers.

Definition at line 368 of file Module.h.

const TypeSymbolTable& llvm::Module::getTypeSymbolTable (  )  const [inline]

TypeSymbolTable& llvm::Module::getTypeSymbolTable (  )  [inline]

Get the Module's symbol table of types.

Definition at line 372 of file Module.h.

global_iterator llvm::Module::global_begin (  )  [inline]

const_global_iterator llvm::Module::global_begin (  )  const [inline]

Get a constant iterator to the first global variable.

Definition at line 381 of file Module.h.

global_iterator llvm::Module::global_end (  )  [inline]

const_global_iterator llvm::Module::global_end (  )  const [inline]

Get a constant iterator to the last global variable.

Definition at line 385 of file Module.h.

bool llvm::Module::global_empty (  )  const [inline]

Determine if the list of globals is empty.

Definition at line 387 of file Module.h.

Referenced by llvm::MSILWriter::printGlobalVariables(), and WriteModuleInfo().

iterator llvm::Module::begin (  )  [inline]

const_iterator llvm::Module::begin (  )  const [inline]

Get a constant iterator to the first function.

Definition at line 396 of file Module.h.

iterator llvm::Module::end (  )  [inline]

const_iterator llvm::Module::end (  )  const [inline]

Get a constant iterator to the last function.

Definition at line 400 of file Module.h.

size_t llvm::Module::size (  )  const [inline]

Determine how many functions are in the Module's list of functions.

Definition at line 402 of file Module.h.

Referenced by getPointerSize().

bool llvm::Module::empty (  )  const [inline]

Determine if the list of functions is empty.

Definition at line 404 of file Module.h.

lib_iterator llvm::Module::lib_begin (  )  const [inline]

Get a constant iterator to beginning of dependent library list.

Definition at line 411 of file Module.h.

Referenced by addLibrary(), llvm::CloneModule(), llvm::Linker::LinkInItems(), llvm::Linker::LinkModules(), and WriteModuleInfo().

lib_iterator llvm::Module::lib_end (  )  const [inline]

Get a constant iterator to end of dependent library list.

Definition at line 413 of file Module.h.

Referenced by addLibrary(), llvm::CloneModule(), llvm::Linker::LinkInItems(), llvm::Linker::LinkModules(), and WriteModuleInfo().

size_t llvm::Module::lib_size (  )  const [inline]

Returns the number of items in the list of libraries.

Definition at line 415 of file Module.h.

void Module::addLibrary ( const StringRef &  Lib  ) 

Add a library to the list of dependent libraries.

Definition at line 380 of file Module.cpp.

References E, lib_begin(), and lib_end().

Referenced by llvm::CloneModule(), and llvm::Linker::LinkModules().

void Module::removeLibrary ( const StringRef &  Lib  ) 

Remove a library from the list of dependent libraries.

Definition at line 387 of file Module.cpp.

References E.

Referenced by llvm::Linker::LinkModules().

const LibraryListType& llvm::Module::getLibraries (  )  const [inline]

Get all the libraries.

Definition at line 421 of file Module.h.

Referenced by llvm::Linker::LinkInLibraries().

alias_iterator llvm::Module::alias_begin (  )  [inline]

const_alias_iterator llvm::Module::alias_begin (  )  const [inline]

Get a constant iterator to the first alias.

Definition at line 430 of file Module.h.

alias_iterator llvm::Module::alias_end (  )  [inline]

const_alias_iterator llvm::Module::alias_end (  )  const [inline]

Get a constant iterator to the last alias.

Definition at line 434 of file Module.h.

size_t llvm::Module::alias_size (  )  const [inline]

Determine how many aliases are in the Module's list of aliases.

Definition at line 436 of file Module.h.

bool llvm::Module::alias_empty (  )  const [inline]

Determine if the list of aliases is empty.

Definition at line 438 of file Module.h.

named_metadata_iterator llvm::Module::named_metadata_begin (  )  [inline]

Get an iterator to the first named metadata.

Definition at line 446 of file Module.h.

Referenced by LinkNamedMDNodes().

const_named_metadata_iterator llvm::Module::named_metadata_begin (  )  const [inline]

Get a constant iterator to the first named metadata.

Definition at line 449 of file Module.h.

named_metadata_iterator llvm::Module::named_metadata_end (  )  [inline]

Get an iterator to the last named metadata.

Definition at line 452 of file Module.h.

Referenced by LinkNamedMDNodes().

const_named_metadata_iterator llvm::Module::named_metadata_end (  )  const [inline]

Get a constant iterator to the last named metadata.

Definition at line 455 of file Module.h.

size_t llvm::Module::named_metadata_size (  )  const [inline]

Determine how many NamedMDNodes are in the Module's list of named metadata.

Definition at line 458 of file Module.h.

bool llvm::Module::named_metadata_empty (  )  const [inline]

Determine if the list of named metadata is empty.

Definition at line 461 of file Module.h.

void Module::print ( raw_ostream &  OS,
AssemblyAnnotationWriter *  AAW 
) const

Print the module to an output stream with AssemblyAnnotationWriter.

Definition at line 2006 of file AsmWriter.cpp.

References OS.

Referenced by dump(), llvm::operator<<(), and print().

void Module::print ( std::ostream &  OS,
AssemblyAnnotationWriter *  AAW 
) const

Definition at line 2002 of file AsmWriter.cpp.

References OS, and print().

void Module::dump (  )  const

Dump the module to stderr (for debugging).

Definition at line 2107 of file AsmWriter.cpp.

References llvm::errs(), and print().

void Module::dropAllReferences (  ) 

This function causes all the subinstructions to "let go" of all references that they are maintaining. This allows one to 'delete' a whole class at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is delete'd for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.

Definition at line 369 of file Module.cpp.

References alias_begin(), alias_end(), begin(), E, end(), global_begin(), and global_end().

Referenced by ~Module().


Friends And Related Function Documentation

friend class Constant [friend]

Definition at line 149 of file Module.h.


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