LLVM API Documentation
The main container class for the LLVM Intermediate Representation. More...
#include <Module.h>
Classes | |
struct | ModuleFlagEntry |
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... | |
enum | ModFlagBehavior { Error = 1, Warning = 2, Require = 3, Override = 4, Append = 5, AppendUnique = 6 } |
This enumeration defines the supported behaviors of module flags. More... | |
typedef iplist< GlobalVariable > | GlobalListType |
The type for the list of global variables. More... | |
typedef iplist< Function > | FunctionListType |
The type for the list of functions. More... | |
typedef iplist< GlobalAlias > | AliasListType |
The type for the list of aliases. More... | |
typedef ilist< NamedMDNode > | NamedMDListType |
The type for the list of named metadata. More... | |
typedef GlobalListType::iterator | global_iterator |
The Global Variable iterator. More... | |
typedef GlobalListType::const_iterator | const_global_iterator |
The Global Variable constant iterator. More... | |
typedef FunctionListType::iterator | iterator |
The Function iterators. More... | |
typedef FunctionListType::const_iterator | const_iterator |
The Function constant iterator. More... | |
typedef AliasListType::iterator | alias_iterator |
The Global Alias iterators. More... | |
typedef AliasListType::const_iterator | const_alias_iterator |
The Global Alias constant iterator. More... | |
typedef NamedMDListType::iterator | named_metadata_iterator |
The named metadata iterators. More... | |
typedef NamedMDListType::const_iterator | const_named_metadata_iterator |
The named metadata constant interators. More... | |
Member Variables | |
class | Constant |
Generic Value Accessors | |
typedef DenseMap< StructType *, unsigned, DenseMapInfo < StructType * > > | NumeredTypesMapTy |
GlobalValue * | getNamedValue (StringRef Name) const |
unsigned | getMDKindID (StringRef Name) const |
void | getMDKindNames (SmallVectorImpl< StringRef > &Result) const |
StructType * | getTypeByName (StringRef Name) const |
Direct access to the globals list, functions list, and symbol table | |
const GlobalListType & | getGlobalList () const |
Get the Module's list of global variables (constant). More... | |
GlobalListType & | getGlobalList () |
Get the Module's list of global variables. More... | |
const FunctionListType & | getFunctionList () const |
Get the Module's list of functions (constant). More... | |
FunctionListType & | getFunctionList () |
Get the Module's list of functions. More... | |
const AliasListType & | getAliasList () const |
Get the Module's list of aliases (constant). More... | |
AliasListType & | getAliasList () |
Get the Module's list of aliases. More... | |
const NamedMDListType & | getNamedMDList () const |
Get the Module's list of named metadata (constant). More... | |
NamedMDListType & | getNamedMDList () |
Get the Module's list of named metadata. More... | |
const ValueSymbolTable & | getValueSymbolTable () const |
Get the symbol table of global variable and function identifiers. More... | |
ValueSymbolTable & | getValueSymbolTable () |
Get the Module's symbol table of global variable and function identifiers. More... | |
static iplist< GlobalVariable > Module::* | getSublistAccess (GlobalVariable *) |
static iplist< Function > Module::* | getSublistAccess (Function *) |
static iplist< GlobalAlias > Module::* | getSublistAccess (GlobalAlias *) |
static ilist< NamedMDNode > Module::* | getSublistAccess (NamedMDNode *) |
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.
typedef iplist<GlobalAlias> llvm::Module::AliasListType |
typedef iplist<Function> llvm::Module::FunctionListType |
typedef DenseMap<StructType*, unsigned, DenseMapInfo<StructType*> > llvm::Module::NumeredTypesMapTy |
This enumeration defines the supported behaviors of module flags.
|
explicit |
The Module constructor. Note that there is no default constructor. You must provide a name for the module upon construction.
Definition at line 45 of file Module.cpp.
Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 52 of file Module.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), and dropAllReferences().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Value * | Val | ||
) |
addModuleFlag - Add a module-level flag to the module-level flags metadata. It will create the module-level flags named metadata if it doesn't already exist.
Definition at line 359 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), getOrInsertModuleFlagsMetadata(), and Int32Ty.
Referenced by addModuleFlag().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 367 of file Module.cpp.
References addModuleFlag(), llvm::ConstantInt::get(), llvm::Type::getInt32Ty(), and Int32Ty.
void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 372 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and getOrInsertModuleFlagsMetadata().
|
inline |
Definition at line 542 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::ValueEnumerator::ValueEnumerator(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 543 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
|
inline |
Definition at line 547 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by llvm::AssemblyWriter::printModule().
|
inline |
Definition at line 544 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::ValueEnumerator::ValueEnumerator(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 545 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
|
inline |
Definition at line 546 of file Module.h.
References llvm::iplist< NodeTy, Traits >::size().
|
inline |
Append to the module-scope inline assembly blocks, automatically inserting a separating newline if necessary.
Definition at line 278 of file Module.h.
References llvm::HexStyle::Asm.
|
inline |
Definition at line 531 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetPreviousFunction(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FunctionPassManager::run(), llvm::MipsOs16::runOnModule(), llvm::Mips16HardFloat::runOnModule(), llvm::FindUsedTypes::runOnModule(), llvm::CallGraph::runOnModule(), llvm::FPPassManager::runOnModule(), StripDebugInfo(), StripSymbolNames(), llvm::ValueEnumerator::ValueEnumerator(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteModule(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 532 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
void Module::Dematerialize | ( | GlobalValue * | GV | ) |
Dematerialize - If the GlobalValue is read in, and if the GVMaterializer supports it, release the memory for the function, and set it up to be materialized lazily. If !isDematerializable(), this method is a noop.
Definition at line 415 of file Module.cpp.
Referenced by llvm::GlobalValue::Dematerialize().
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 450 of file Module.cpp.
References alias_begin(), alias_end(), begin(), end(), global_begin(), global_end(), and I.
Referenced by ~Module().
void Module::dump | ( | ) | const |
Dump the module to stderr (for debugging).
Definition at line 2218 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::DebugIR::runOnModule().
|
inline |
Definition at line 536 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
|
inline |
Definition at line 533 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetNextFunction(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FunctionPassManager::run(), llvm::MipsOs16::runOnModule(), llvm::Mips16HardFloat::runOnModule(), llvm::FindUsedTypes::runOnModule(), llvm::CallGraph::runOnModule(), llvm::FPPassManager::runOnModule(), StripDebugInfo(), StripSymbolNames(), llvm::ValueEnumerator::ValueEnumerator(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteModule(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 534 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
void Module::eraseNamedMetadata | ( | NamedMDNode * | NMD | ) |
eraseNamedMetadata - Remove the given NamedMDNode from this module and delete it.
Definition at line 308 of file Module.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), and llvm::NamedMDNode::getName().
Referenced by llvm::NamedMDNode::eraseFromParent().
|
inline |
Get the Module's list of aliases (constant).
Definition at line 499 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent(), llvm::GlobalAlias::GlobalAlias(), and llvm::GlobalAlias::removeFromParent().
|
inline |
|
inline |
Get the global data context.
Definition at line 249 of file Module.h.
Referenced by llvm::IntrinsicLowering::AddPrototypes(), appendToGlobalArray(), assureFPCallStub(), llvm::CloneModule(), createFPFnStub(), createFree(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), EmitGCCInlineAsmStr(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), EmitMSInlineAsmStr(), llvm::EmitPutS(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), EnsureFPIntrinsicsExist(), fixupFPReturnAndCall(), GenerateARCBBEntranceAnnotation(), GenerateARCBBTerminatorAnnotation(), llvm::Intrinsic::getDeclaration(), getTypeByName(), llvm::NVPTXLowerAggrCopies::runOnFunction(), and SwitchToLookupTable().
|
inline |
Get the data layout string for the module's target platform. This encodes the type sizes and alignments expected by this module.
Definition at line 233 of file Module.h.
Referenced by llvm::CloneModule(), llvm::DataLayout::DataLayout(), llvm::AssemblyWriter::printModule(), and WriteModuleInfo().
Module::Endianness Module::getEndianness | ( | ) | const |
Target endian information.
Get the target endian information.
Definition at line 64 of file Module.cpp.
References AnyEndianness, BigEndian, llvm::StringRef::empty(), llvm::getToken(), LittleEndian, and P.
getFunction - Look up the specified function in the module symbol table. If it does not exist, return null.
Definition at line 221 of file Module.cpp.
References getNamedValue().
Referenced by assureFPCallStub(), llvm::AsmPrinter::doFinalization(), FindCXAAtExit(), llvm::MCJIT::findModuleForSymbol(), llvm::SparcTargetLowering::getSRetArgSize(), hasReturnsTwiceAttr(), and StripDebugInfo().
|
inline |
Get the Module's list of functions (constant).
Definition at line 492 of file Module.h.
Referenced by llvm::Function::eraseFromParent(), llvm::Function::removeFromParent(), and llvm::CallGraph::removeFunctionFromModule().
|
inline |
|
inline |
Get the Module's list of global variables (constant).
Definition at line 485 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doFinalization(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalVariable::GlobalVariable(), InstallGlobalCtors(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalVariable::removeFromParent(), SRAGlobal(), and TryToShrinkGlobalToBoolean().
|
inline |
|
inline |
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.
Definition at line 355 of file Module.h.
Referenced by llvm::MachineModuleInfo::AnalyzeModule(), llvm::collectUsedGlobalVariables(), llvm::MCJIT::findModuleForSymbol(), GenerateARCBBEntranceAnnotation(), GenerateARCBBTerminatorAnnotation(), getNamedGlobal(), and StripSymbolNames().
GlobalVariable * Module::getGlobalVariable | ( | StringRef | Name, |
bool | AllowLocal = false |
||
) |
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 236 of file Module.cpp.
References getNamedValue().
|
inline |
getMaterializer - Retrieves the GVMaterializer, if any, for this Module.
Definition at line 449 of file Module.h.
Referenced by llvm::ParseBitcodeFile().
getMDKindID - Return a unique non-zero ID for the specified metadata kind. This ID is uniqued across modules in the current LLVMContext.
Definition at line 117 of file Module.cpp.
References llvm::LLVMContext::getMDKindID().
Referenced by llvm::UpgradeIntrinsicCall().
void Module::getMDKindNames | ( | SmallVectorImpl< StringRef > & | Result | ) | const |
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext.
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext. ID #0 is not used, so it is filled in as an empty string.
Definition at line 124 of file Module.cpp.
References llvm::LLVMContext::getMDKindNames().
Referenced by WriteModuleMetadataStore().
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 331 of file Module.cpp.
References getModuleFlagsMetadata(), llvm::MDString::getString(), I, llvm::Module::ModuleFlagEntry::Key, llvm::SmallVectorTemplateCommon< T >::size(), and llvm::Module::ModuleFlagEntry::Val.
Referenced by getDwarfVersionFromModule().
void Module::getModuleFlagsMetadata | ( | SmallVectorImpl< ModuleFlagEntry > & | Flags | ) | const |
getModuleFlagsMetadata - Returns the module flags in the provided vector.
Definition at line 315 of file Module.cpp.
References getModuleFlagsMetadata(), llvm::NamedMDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::NamedMDNode::getOperand(), llvm::ConstantInt::getZExtValue(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::AsmPrinter::doFinalization().
NamedMDNode * Module::getModuleFlagsMetadata | ( | ) | const |
getModuleFlagsMetadata - Returns the NamedMDNode in the module that represents module-level flags. This method returns null if there are no module-level flags.
Definition at line 345 of file Module.cpp.
References getNamedMetadata().
Referenced by getModuleFlag(), and getModuleFlagsMetadata().
|
inline |
Get the module identifier which is, essentially, the name of the module.
Definition at line 228 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), EmitCamlGlobal(), llvm::SpecialCaseList::isIn(), and llvm::AssemblyWriter::printModule().
|
inline |
Get any module-scope inline assembly blocks.
Definition at line 253 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::AssemblyWriter::printModule(), and WriteModuleInfo().
GlobalAlias * Module::getNamedAlias | ( | StringRef | Name | ) | const |
getNamedAlias - Return the 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 279 of file Module.cpp.
References getNamedValue().
|
inline |
getNamedGlobal - Return the 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 365 of file Module.h.
References getGlobalVariable().
Referenced by appendToGlobalArray(), getNamedGlobal(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().
|
inline |
Definition at line 368 of file Module.h.
References getNamedGlobal().
|
inline |
|
inline |
NamedMDNode * Module::getNamedMetadata | ( | const Twine & | 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.
Definition at line 286 of file Module.cpp.
References lookup(), and llvm::Twine::toStringRef().
Referenced by llvm::DwarfDebug::beginModule(), cacheAnnotationFromMD(), llvm::getFnSpecificMDNode(), getModuleFlagsMetadata(), and llvm::DebugInfoFinder::processModule().
GlobalValue * Module::getNamedValue | ( | StringRef | Name | ) | const |
getNamedValue - Return the 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 111 of file Module.cpp.
References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().
Referenced by forceRenaming(), getFunction(), getGlobalVariable(), getNamedAlias(), getOrInsertFunction(), getOrInsertGlobal(), and llvm::objcarc::ModuleHasARC().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T, | ||
AttributeSet | AttributeList | ||
) |
getOrInsertFunction - Look up the specified function in the module symbol table. Four possibilities:
Definition at line 138 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::iplist< NodeTy, Traits >::push_back(), llvm::Function::setAttributes(), and llvm::Value::setName().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), createFree(), createMalloc(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), llvm::EmitUnaryFloatFnCall(), EnsureFunctionExists(), fixupFPReturnAndCall(), GenerateARCBBEntranceAnnotation(), GenerateARCBBTerminatorAnnotation(), llvm::Intrinsic::getDeclaration(), getOrInsertFunction(), ReplaceCallWith(), and llvm::InstCombiner::visitFPTrunc().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T | ||
) |
Definition at line 171 of file Module.cpp.
References getOrInsertFunction().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
AttributeSet | AttributeList, | ||
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 181 of file Module.cpp.
References llvm::FunctionType::get(), and getOrInsertFunction().
getOrInsertFunction - Same as above, but without the attributes.
Definition at line 200 of file Module.cpp.
References llvm::FunctionType::get(), and getOrInsertFunction().
getOrInsertGlobal - Look up the specified global in the module symbol table.
Definition at line 250 of file Module.cpp.
References llvm::GlobalValue::ExternalLinkage, llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::Type::getPointerAddressSpace(), and llvm::GlobalValue::getType().
Referenced by CreatePrologue().
NamedMDNode * Module::getOrInsertModuleFlagsMetadata | ( | ) |
getOrInsertModuleFlagsMetadata - Returns the NamedMDNode in the module that represents module-level flags. If module-level flags aren't found, it creates the named metadata that contains them.
Definition at line 352 of file Module.cpp.
References getOrInsertNamedMetadata().
Referenced by addModuleFlag().
NamedMDNode * Module::getOrInsertNamedMetadata | ( | StringRef | Name | ) |
getOrInsertNamedMetadata - Return the 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 295 of file Module.cpp.
References llvm::ilist< NodeTy >::push_back().
Referenced by llvm::CloneModule(), llvm::DIBuilder::createCompileUnit(), llvm::getOrInsertFnSpecificMDNode(), and getOrInsertModuleFlagsMetadata().
Module::PointerSize Module::getPointerSize | ( | ) | const |
Target Pointer Size information.
Get the target pointer size.
Definition at line 85 of file Module.cpp.
References AnyPointerSize, llvm::StringRef::empty(), llvm::getToken(), Pointer32, Pointer64, and size().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Get the target triple which is a string describing the target host.
Definition at line 237 of file Module.h.
Referenced by llvm::CloneModule(), llvm::EngineBuilder::create(), LTOModule::getTargetTriple(), llvm::AssemblyWriter::printModule(), llvm::EngineBuilder::selectTarget(), llvm::WriteBitcodeToFile(), and WriteModuleInfo().
StructType * Module::getTypeByName | ( | StringRef | Name | ) | const |
getTypeByName - Return the type with the specified name, or null if there is none by that name.
Definition at line 618 of file Type.cpp.
References getContext(), llvm::LLVMContextImpl::NamedStructTypes, and llvm::LLVMContext::pImpl.
|
inline |
Get the symbol table of global variable and function identifiers.
Definition at line 513 of file Module.h.
Referenced by getNamedValue(), llvm::ValueEnumerator::ValueEnumerator(), and WriteModule().
|
inline |
|
inline |
Definition at line 521 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ExecutionEngine::emitGlobals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetPreviousGlobal(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FindUsedTypes::runOnModule(), StripSymbolNames(), llvm::ValueEnumerator::ValueEnumerator(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 522 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
|
inline |
Definition at line 525 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by llvm::AssemblyWriter::printModule(), and WriteModuleInfo().
|
inline |
Definition at line 523 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ExecutionEngine::emitGlobals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetNextGlobal(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FindUsedTypes::runOnModule(), StripSymbolNames(), llvm::ValueEnumerator::ValueEnumerator(), WriteModuleInfo(), and WriteModuleUseLists().
|
inline |
Definition at line 524 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
bool Module::isDematerializable | ( | const GlobalValue * | GV | ) | const |
isDematerializable - Returns true if this GV was loaded from this Module's GVMaterializer and the GVMaterializer knows how to dematerialize the GV.
Definition at line 397 of file Module.cpp.
Referenced by llvm::GlobalValue::isDematerializable().
bool Module::isMaterializable | ( | const GlobalValue * | GV | ) | const |
isMaterializable - True if the definition of GV has yet to be materialized from the GVMaterializer.
Definition at line 391 of file Module.cpp.
Referenced by llvm::GlobalValue::isMaterializable().
bool Module::Materialize | ( | GlobalValue * | GV, |
std::string * | ErrInfo = 0 |
||
) |
Materialize - Make sure the GlobalValue is fully read. If the module is corrupt, this returns true and fills in the optional string with information about the problem. If successful, this returns false.
Definition at line 403 of file Module.cpp.
References llvm::error_code::message().
Referenced by llvm::GlobalValue::Materialize().
bool Module::MaterializeAll | ( | std::string * | ErrInfo = 0 | ) |
MaterializeAll - Make sure all GlobalValues in this Module are fully read. If the module is corrupt, this returns true and fills in the optional string with information about the problem. If successful, this returns false.
Definition at line 420 of file Module.cpp.
References llvm::error_code::message().
Referenced by MaterializeAllPermanently().
bool Module::MaterializeAllPermanently | ( | std::string * | ErrInfo = 0 | ) |
MaterializeAllPermanently - Make sure all GlobalValues in this Module are fully read and clear the Materializer. If the module is corrupt, this returns true, fills in the optional string with information about the problem, and DOES NOT clear the old Materializer. If successful, this returns false.
Definition at line 431 of file Module.cpp.
References MaterializeAll().
Referenced by llvm::Interpreter::create(), and llvm::ParseBitcodeFile().
|
inline |
Definition at line 554 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), StripDebugInfo(), and WriteModuleMetadata().
|
inline |
Definition at line 555 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
|
inline |
Definition at line 565 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by llvm::AssemblyWriter::printModule().
|
inline |
Definition at line 559 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), StripDebugInfo(), and WriteModuleMetadata().
|
inline |
Definition at line 560 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
|
inline |
Definition at line 564 of file Module.h.
References llvm::iplist< NodeTy, Traits >::size().
void Module::print | ( | raw_ostream & | OS, |
AssemblyAnnotationWriter * | AAW | ||
) | const |
Print the module to an output stream with an optional AssemblyAnnotationWriter.
Definition at line 2132 of file AsmWriter.cpp.
References llvm::AssemblyWriter::printModule().
Referenced by dump(), and llvm::operator<<().
|
inline |
void Module::setMaterializer | ( | GVMaterializer * | GVM | ) |
setMaterializer - Sets the GVMaterializer to GVM. This module must not yet have a Materializer. To reset the materializer for a module that already has one, call MaterializeAllPermanently first. Destroying this module will destroy its materializer without materializing any more GlobalValues. Without destroying the Module, there is no way to detach or destroy a materializer without materializing all the GVs it controls, to avoid leaving orphan unmaterialized GVs.
Definition at line 384 of file Module.cpp.
Referenced by llvm::getLazyBitcodeModule(), and llvm::getStreamedBitcodeModule().
|
inline |
|
inline |
Set the module-scope inline assembly blocks.
Definition at line 269 of file Module.h.
References llvm::HexStyle::Asm.
Referenced by llvm::CloneModule().
|
inline |
Set the target triple.
Definition at line 266 of file Module.h.
References T.
Referenced by llvm::CloneModule(), and LTOModule::setTargetTriple().
|
inline |
Definition at line 535 of file Module.h.
References llvm::iplist< NodeTy, Traits >::size().
Referenced by llvm::DwarfUnits::computeSizeAndOffset(), llvm::DwarfDebug::emitDIE(), and getPointerSize().