LLVM API Documentation
#include <Module.h>
Collaboration diagram for llvm::Module:
Public Types | |
typedef iplist< GlobalVariable > | GlobalListType |
typedef iplist< Function > | FunctionListType |
typedef SetVector< std::string > | LibraryListType |
typedef GlobalListType::iterator | giterator |
typedef GlobalListType::const_iterator | const_giterator |
typedef std::reverse_iterator< giterator > | reverse_giterator |
typedef std::reverse_iterator< const_giterator > | const_reverse_giterator |
typedef FunctionListType::iterator | iterator |
typedef FunctionListType::const_iterator | const_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef LibraryListType::const_iterator | lib_iterator |
enum | Endianness { AnyEndianness, LittleEndian, BigEndian } |
enum | PointerSize { AnyPointerSize, Pointer32, Pointer64 } |
Public Member Functions | |
Module (const std::string &ModuleID) | |
~Module () | |
const std::string & | getModuleIdentifier () const |
const std::string & | getTargetTriple () const |
void | setTargetTriple (const std::string &T) |
Endianness | getEndianness () const |
Target endian information... | |
void | setEndianness (Endianness E) |
PointerSize | getPointerSize () const |
Target Pointer Size information... | |
void | setPointerSize (PointerSize PS) |
Function * | getOrInsertFunction (const std::string &Name, const FunctionType *T) |
Function * | getOrInsertFunction (const std::string &Name, const Type *RetTy,...) |
Function * | getFunction (const std::string &Name, const FunctionType *Ty) |
Function * | getMainFunction () |
Function * | getNamedFunction (const std::string &Name) |
GlobalVariable * | getGlobalVariable (const std::string &Name, const Type *Ty) |
bool | addTypeName (const std::string &Name, const Type *Ty) |
std::string | getTypeName (const Type *Ty) const |
const Type * | getTypeByName (const std::string &Name) const |
const GlobalListType & | getGlobalList () const |
Get the underlying elements of the Module... | |
GlobalListType & | getGlobalList () |
const FunctionListType & | getFunctionList () const |
FunctionListType & | getFunctionList () |
SymbolTable & | getSymbolTable () |
const SymbolTable & | getSymbolTable () const |
giterator | gbegin () |
const_giterator | gbegin () const |
giterator | gend () |
const_giterator | gend () const |
reverse_giterator | grbegin () |
const_reverse_giterator | grbegin () const |
reverse_giterator | grend () |
const_reverse_giterator | grend () const |
size_t | gsize () const |
bool | gempty () const |
const GlobalVariable & | gfront () const |
GlobalVariable & | gfront () |
const GlobalVariable & | gback () const |
GlobalVariable & | gback () |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_t | size () const |
bool | empty () const |
const Function & | front () const |
Function & | front () |
const Function & | back () const |
Function & | back () |
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 std::string &Lib) |
Add a library to the list of dependent libraries. | |
void | removeLibrary (const std::string &Lib) |
Remove a library from the list of dependent libraries. | |
const LibraryListType & | getLibraries () const |
Get all the libraries. | |
void | print (std::ostream &OS) const |
void | print (std::ostream &OS, AssemblyAnnotationWriter *AAW) const |
void | dump () const |
void | dropAllReferences () |
Friends | |
class | Constant |
Definition at line 46 of file Module.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 63 of file Module.cpp. |
|
Definition at line 72 of file Module.cpp. References llvm::SetVector< T >::clear(), and dropAllReferences(). |
|
Add a library to the list of dependent libraries.
Definition at line 237 of file Module.h. References llvm::SetVector< T >::insert(). Referenced by llvm::LinkModules(), and llvm::BytecodeReader::ParseModuleGlobalInfo(). |
|
addTypeName - Insert an entry in the symbol table mapping Str to Type. If there is already an entry for this name, true is returned and the symbol table is not modified. Definition at line 236 of file Module.cpp. References getSymbolTable(), llvm::SymbolTable::insert(), and llvm::SymbolTable::lookupType(). Referenced by llvm::CloneModule(), and setTypeName(). |
|
|
|
|
|
|
|
|
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 285 of file Module.cpp. References begin(), E, end(), gbegin(), gend(), and I. Referenced by ~Module(). |
|
Definition at line 83 of file Module.cpp. References print(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 189 of file Module.h. Referenced by llvm::CloneModule(), dropAllReferences(), llvm::GetAllDefinedSymbols(), llvm::GetAllUndefinedSymbols(), getSymbols(), LinkGlobalInits(), LinkGlobals(), llvm::LinkModules(), llvm::Mangler::Mangler(), llvm::LocalDataStructures::runOnModule(), and llvm::FindUsedTypes::runOnModule(). |
|
|
|
|
|
Definition at line 191 of file Module.h. Referenced by llvm::CloneModule(), dropAllReferences(), llvm::GetAllDefinedSymbols(), llvm::GetAllUndefinedSymbols(), getSymbols(), LinkGlobalInits(), LinkGlobals(), llvm::LinkModules(), llvm::Mangler::Mangler(), llvm::LocalDataStructures::runOnModule(), and llvm::FindUsedTypes::runOnModule(). |
|
Target endian information...
Definition at line 94 of file Module.h. Referenced by llvm::BytecodeWriter::BytecodeWriter(), llvm::CloneModule(), llvm::Interpreter::create(), llvm::X86TargetMachine::getModuleMatchQuality(), llvm::PPC64TargetMachine::getModuleMatchQuality(), llvm::PPC32TargetMachine::getModuleMatchQuality(), llvm::LinkModules(), and llvm::TargetData::TargetData(). |
|
getFunction - Look up the specified function in the module symbol table. If it does not exist, return null. Definition at line 135 of file Module.cpp. References llvm::PointerType::get(), getSymbolTable(), and llvm::SymbolTable::lookup(). Referenced by getMainFunction(), and LinkFunctionProtos(). |
|
|
|
Definition at line 175 of file Module.h. Referenced by llvm::Function::eraseFromParent(), llvm::Function::Function(), llvm::Function::removeFromParent(), llvm::CallGraph::removeFunctionFromModule(), ResolveFunctions(), and llvm::RunVMAsmParser(). |
|
|
|
Get the underlying elements of the Module...
Definition at line 173 of file Module.h. Referenced by llvm::GlobalVariable::eraseFromParent(), getStringRef(), llvm::GlobalVariable::GlobalVariable(), LinkAppendingVars(), LinkGlobals(), OptimizeGlobalAddressOfMalloc(), ParseGlobalVariable(), llvm::GlobalVariable::removeFromParent(), ResolveGlobalVariables(), llvm::ProfilePaths::runOnFunction(), and SRAGlobal(). |
|
getGlobalVariable - Look up the specified global variable in the module symbol table. If it does not exist, return null. Note that this only returns a global variable if it does not have internal linkage. 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. Definition at line 215 of file Module.cpp. References llvm::PointerType::get(), getSymbolTable(), llvm::GlobalValue::hasInternalLinkage(), and V. Referenced by llvm::ProgramInfo::getSourceFiles(), llvm::ProgramInfo::getSourceFunctions(), LinkGlobals(), and ParseGlobalVariable(). |
|
Get all the libraries.
Definition at line 243 of file Module.h. Referenced by llvm::GetBytecodeDependentLibraries(), and llvm::LinkLibraries(). |
|
getMainFunction - This function looks up main efficiently. This is such a common case, that it is a method in Module. If main cannot be found, a null pointer is returned. Definition at line 145 of file Module.cpp. References F, llvm::PointerType::get(), llvm::FunctionType::get(), getFunction(), getNamedFunction(), llvm::Type::IntTy, llvm::Type::SByteTy, and llvm::Type::VoidTy. Referenced by llvm::TDDataStructures::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule(). |
|
Definition at line 89 of file Module.h. Referenced by llvm::CloneModule(), llvm::LinkModules(), llvm::PMDebug::PrintPassInformation(), and llvm::ProgramInfo::ProgramInfo(). |
|
getNamedFunction - Return the first function in the module with the specified name, of arbitrary type. This method returns null if a function with the specified name is not found. Definition at line 192 of file Module.cpp. References begin(), E, end(), and I. Referenced by CheckVarargs(), EnsureFunctionExists(), getMainFunction(), getPointerToNamedFunction(), ReplaceCallWith(), and llvm::RunVMAsmParser(). |
|
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 version of the method takes a null terminated list of function arguments, which makes it easier for clients to use. Definition at line 115 of file Module.cpp. References llvm::FunctionType::get(), and getOrInsertFunction(). |
|
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. Definition at line 96 of file Module.cpp. References llvm::GlobalValue::ExternalLinkage, llvm::PointerType::get(), getSymbolTable(), llvm::SymbolTable::lookup(), and V. Referenced by CheckVarargs(), Cilkifier::Cilkifier(), EnsureFunctionExists(), getOrInsertFunction(), llvm::getTriggerCode(), InsertInstrumentationCall(), llvm::InsertProfilingInitCall(), ReplaceCallWith(), llvm::ProfilePaths::runOnFunction(), and llvm::RunVMAsmParser(). |
|
Target Pointer Size information...
Definition at line 98 of file Module.h. Referenced by llvm::BytecodeWriter::BytecodeWriter(), llvm::CloneModule(), llvm::Interpreter::create(), llvm::X86TargetMachine::getModuleMatchQuality(), llvm::PPC64TargetMachine::getModuleMatchQuality(), llvm::PPC32TargetMachine::getModuleMatchQuality(), llvm::LinkModules(), lle_X_sprintf(), and llvm::TargetData::TargetData(). |
|
|
|
getSymbolTable() - Get access to the symbol table for the module, where global variables and functions are identified. Definition at line 181 of file Module.h. Referenced by addTypeName(), llvm::BytecodeWriter::BytecodeWriter(), llvm::CloneModule(), fillTypeNameTable(), ForceRenaming(), getFunction(), getGlobalVariable(), getOrInsertFunction(), getTypeByName(), getTypeName(), LinkFunctionProtos(), LinkGlobals(), LinkTypes(), lookupInSymbolTable(), llvm::BytecodeReader::ParseModule(), llvm::Function::renameLocalSymbols(), llvm::GlobalVariable::setName(), and llvm::Function::setName(). |
|
|
|
getTypeByName - Return the type with the specified name in this module, or null if there is none by that name. Definition at line 250 of file Module.cpp. References getSymbolTable(), and llvm::SymbolTable::lookupType(). Referenced by getTypeVal(), and setTypeName(). |
|
getTypeName - If there is at least one entry in the symbol table for the specified type, return it. Definition at line 258 of file Module.cpp. References getSymbolTable(), llvm::SymbolTable::type_begin(), and llvm::SymbolTable::type_end(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Get a constant iterator to beginning of dependent library list.
Definition at line 228 of file Module.h. References llvm::SetVector< T >::begin(). Referenced by llvm::LinkModules(). |
|
Get a constant iterator to end of dependent library list.
Definition at line 231 of file Module.h. References llvm::SetVector< T >::end(). Referenced by llvm::LinkModules(). |
|
Returns the number of items in the list of libraries.
Definition at line 234 of file Module.h. References llvm::SetVector< T >::size(). |
|
Definition at line 1188 of file AsmWriter.cpp. References llvm::AssemblyWriter::write(). |
|
Definition at line 248 of file Module.h. Referenced by dump(), and llvm::operator<<(). |
|
|
|
|
|
Remove a library from the list of dependent libraries.
Definition at line 240 of file Module.h. References llvm::SetVector< T >::remove(). Referenced by llvm::LinkModules(). |
|
|
|
|
|
Definition at line 95 of file Module.h. Referenced by llvm::CloneModule(), llvm::LinkModules(), and llvm::BytecodeReader::ParseVersionInfo(). |
|
Definition at line 99 of file Module.h. Referenced by llvm::CloneModule(), llvm::LinkModules(), and llvm::BytecodeReader::ParseVersionInfo(). |
|
Definition at line 91 of file Module.h. Referenced by llvm::BytecodeReader::ParseModuleGlobalInfo(). |
|
|
|
|