LLVM API Documentation
The main container class for the LLVM Intermediate Representation. More...
#include <Module.h>
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 |
This enumeration defines the supported behaviors of module flags.
Module::Module | ( | 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 48 of file Module.cpp.
Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 55 of file Module.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), and dropAllReferences().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Value * | Val | ||
) |
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.
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 322 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), and getOrInsertModuleFlagsMetadata().
Referenced by addModuleFlag().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 330 of file Module.cpp.
References addModuleFlag(), llvm::ConstantInt::get(), and llvm::Type::getInt32Ty().
void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 335 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and getOrInsertModuleFlagsMetadata().
alias_iterator llvm::Module::alias_begin | ( | ) | [inline] |
Definition at line 541 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), and llvm::ValueEnumerator::ValueEnumerator().
const_alias_iterator llvm::Module::alias_begin | ( | ) | const [inline] |
Definition at line 542 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
bool llvm::Module::alias_empty | ( | ) | const [inline] |
Definition at line 546 of file Module.h.
Referenced by llvm::AssemblyWriter::printModule().
alias_iterator llvm::Module::alias_end | ( | ) | [inline] |
Definition at line 543 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), skipEmpty(), and llvm::ValueEnumerator::ValueEnumerator().
const_alias_iterator llvm::Module::alias_end | ( | ) | const [inline] |
Definition at line 544 of file Module.h.
References llvm::iplist< NodeTy, Traits >::end().
size_t llvm::Module::alias_size | ( | ) | const [inline] |
Definition at line 545 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
iterator_range<alias_iterator> llvm::Module::aliases | ( | ) | [inline] |
Definition at line 548 of file Module.h.
Referenced by dropAllReferences(), and orderModule().
iterator_range<const_alias_iterator> llvm::Module::aliases | ( | ) | const [inline] |
void llvm::Module::appendModuleInlineAsm | ( | StringRef | Asm | ) | [inline] |
iterator llvm::Module::begin | ( | ) | [inline] |
Definition at line 528 of file Module.h.
Referenced by llvm::IntrinsicLowering::AddPrototypes(), llvm::CallGraph::CallGraph(), llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetPreviousFunction(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run(), llvm::MipsOs16::runOnModule(), llvm::Mips16HardFloat::runOnModule(), llvm::FindUsedTypes::runOnModule(), llvm::FPPassManager::runOnModule(), llvm::StripDebugInfo(), StripSymbolNames(), llvm::object::IRObjectFile::symbol_begin_impl(), llvm::ValueEnumerator::ValueEnumerator(), llvm::verifyModule(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), and WriteModule().
const_iterator llvm::Module::begin | ( | ) | const [inline] |
void Module::Dematerialize | ( | GlobalValue * | GV | ) |
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 416 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 447 of file Module.cpp.
References aliases(), llvm::Function::dropAllReferences(), F(), and globals().
Referenced by ~Module().
void Module::dump | ( | ) | const |
Dump the module to stderr (for debugging).
Definition at line 2562 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::DebugIR::runOnModule().
bool llvm::Module::empty | ( | ) | const [inline] |
iterator llvm::Module::end | ( | ) | [inline] |
Definition at line 530 of file Module.h.
Referenced by llvm::IntrinsicLowering::AddPrototypes(), llvm::CallGraph::CallGraph(), llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetNextFunction(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run(), llvm::MipsOs16::runOnModule(), llvm::Mips16HardFloat::runOnModule(), llvm::FindUsedTypes::runOnModule(), llvm::FPPassManager::runOnModule(), llvm::StripDebugInfo(), StripSymbolNames(), llvm::ValueEnumerator::ValueEnumerator(), llvm::verifyModule(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), and WriteModule().
const_iterator llvm::Module::end | ( | ) | const [inline] |
void Module::eraseNamedMetadata | ( | NamedMDNode * | NMD | ) |
Remove the given NamedMDNode from this module and delete it.
eraseNamedMetadata - Remove the given NamedMDNode from this module and delete it.
Definition at line 257 of file Module.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), and llvm::NamedMDNode::getName().
Referenced by llvm::NamedMDNode::eraseFromParent().
const AliasListType& llvm::Module::getAliasList | ( | ) | const [inline] |
Get the Module's list of aliases (constant).
Definition at line 489 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent(), and llvm::GlobalAlias::removeFromParent().
AliasListType& llvm::Module::getAliasList | ( | ) | [inline] |
const ComdatSymTabType& llvm::Module::getComdatSymbolTable | ( | ) | const [inline] |
ComdatSymTabType& llvm::Module::getComdatSymbolTable | ( | ) | [inline] |
LLVMContext& llvm::Module::getContext | ( | ) | const [inline] |
Get the global data context.
Definition at line 260 of file Module.h.
Referenced by llvm::IntrinsicLowering::AddPrototypes(), appendToGlobalArray(), assureFPCallStub(), llvm::CloneModule(), createFPFnStub(), createFree(), createPrivateGlobalForSourceLoc(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), EmitGCCInlineAsmStr(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), EmitMSInlineAsmStr(), llvm::EmitPutS(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), EnsureFPIntrinsicsExist(), fixupFPReturnAndCall(), llvm::Intrinsic::getDeclaration(), getTypeByName(), llvm::legacy::PassManagerImpl::run(), llvm::ModulePassManager::run(), llvm::NVPTXLowerAggrCopies::runOnFunction(), SwitchToLookupTable(), and llvm::UpgradeDebugInfo().
const DataLayout * Module::getDataLayout | ( | ) | const |
Get the data layout for the module's target platform.
Definition at line 366 of file Module.cpp.
Referenced by llvm::CloneModule(), llvm::GlobalValue::getDataLayout(), and llvm::DataLayout::init().
const std::string& llvm::Module::getDataLayoutStr | ( | ) | const [inline] |
Get the data layout string for the module's target platform. This is equivalent to getDataLayout()->getStringRepresentation().
Definition at line 249 of file Module.h.
Referenced by llvm::AssemblyWriter::printModule(), and WriteModuleInfo().
unsigned Module::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version by checking module flags.
Definition at line 458 of file Module.cpp.
References llvm::dwarf::DWARF_VERSION, and getModuleFlag().
Referenced by llvm::DwarfDebug::DwarfDebug().
Function * Module::getFunction | ( | StringRef | Name | ) | const |
Look up the specified function in the module symbol table. If it does not exist, return null.
Definition at line 170 of file Module.cpp.
References getNamedValue().
Referenced by assureFPCallStub(), FindCXAAtExit(), llvm::MCJIT::findModuleForSymbol(), llvm::SparcTargetLowering::getSRetArgSize(), hasReturnsTwiceAttr(), and llvm::StripDebugInfo().
const FunctionListType& llvm::Module::getFunctionList | ( | ) | const [inline] |
Get the Module's list of functions (constant).
Definition at line 482 of file Module.h.
Referenced by llvm::Function::eraseFromParent(), llvm::Function::removeFromParent(), and llvm::CallGraph::removeFunctionFromModule().
FunctionListType& llvm::Module::getFunctionList | ( | ) | [inline] |
const GlobalListType& llvm::Module::getGlobalList | ( | ) | const [inline] |
Get the Module's list of global variables (constant).
Definition at line 475 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doFinalization(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalVariable::GlobalVariable(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalVariable::removeFromParent(), SRAGlobal(), and TryToShrinkGlobalToBoolean().
GlobalListType& llvm::Module::getGlobalList | ( | ) | [inline] |
const GlobalVariable* llvm::Module::getGlobalVariable | ( | StringRef | Name, |
bool | AllowInternal = false |
||
) | const [inline] |
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 359 of file Module.h.
Referenced by llvm::MachineModuleInfo::AnalyzeModule(), llvm::collectUsedGlobalVariables(), llvm::MCJIT::findModuleForSymbol(), 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 185 of file Module.cpp.
References getNamedValue().
GVMaterializer* llvm::Module::getMaterializer | ( | ) | const [inline] |
Retrieves the GVMaterializer, if any, for this Module.
unsigned Module::getMDKindID | ( | StringRef | Name | ) | const |
Return a unique non-zero ID for the specified metadata kind. This ID is uniqued across modules in the current LLVMContext.
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 76 of file Module.cpp.
References llvm::LLVMContext::getMDKindID().
Referenced by llvm::UpgradeIntrinsicCall().
void Module::getMDKindNames | ( | SmallVectorImpl< StringRef > & | Result | ) | const |
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 83 of file Module.cpp.
References llvm::LLVMContext::getMDKindNames().
Referenced by WriteModuleMetadataStore().
Value * Module::getModuleFlag | ( | StringRef | Key | ) | const |
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 295 of file Module.cpp.
References getModuleFlagsMetadata().
Referenced by llvm::getDebugMetadataVersionFromModule(), and getDwarfVersion().
void Module::getModuleFlagsMetadata | ( | SmallVectorImpl< ModuleFlagEntry > & | Flags | ) | const |
Returns the module flags in the provided vector.
getModuleFlagsMetadata - Returns the module flags in the provided vector.
Definition at line 275 of file Module.cpp.
References getModuleFlagsMetadata(), isValidModFlagBehavior(), llvm::NamedMDNode::operands(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
NamedMDNode * Module::getModuleFlagsMetadata | ( | ) | const |
Returns the NamedMDNode in the module that represents module-level flags. This method returns null if there are no module-level flags.
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 308 of file Module.cpp.
References getNamedMetadata().
Referenced by getModuleFlag(), and getModuleFlagsMetadata().
const std::string& llvm::Module::getModuleIdentifier | ( | ) | const [inline] |
Get the module identifier which is, essentially, the name of the module.
Definition at line 245 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), EmitCamlGlobal(), llvm::LazyCallGraph::LazyCallGraph(), llvm::DiagnosticPrinterRawOStream::operator<<(), llvm::AssemblyWriter::printModule(), and llvm::LazyCallGraphPrinterPass::run().
const std::string& llvm::Module::getModuleInlineAsm | ( | ) | const [inline] |
Get any module-scope inline assembly blocks.
Definition at line 264 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::AssemblyWriter::printModule(), and WriteModuleInfo().
GlobalAlias * Module::getNamedAlias | ( | StringRef | Name | ) | const |
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 228 of file Module.cpp.
References getNamedValue().
GlobalVariable* llvm::Module::getNamedGlobal | ( | StringRef | Name | ) | [inline] |
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 369 of file Module.h.
Referenced by appendToGlobalArray(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().
const GlobalVariable* llvm::Module::getNamedGlobal | ( | StringRef | Name | ) | const [inline] |
Definition at line 372 of file Module.h.
References getGlobalVariable().
const NamedMDListType& llvm::Module::getNamedMDList | ( | ) | const [inline] |
NamedMDListType& llvm::Module::getNamedMDList | ( | ) | [inline] |
NamedMDNode * Module::getNamedMetadata | ( | const Twine & | Name | ) | const |
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 specified name is not found.
Definition at line 235 of file Module.cpp.
References lookup(), and llvm::Twine::toStringRef().
Referenced by llvm::DwarfDebug::beginModule(), cacheAnnotationFromMD(), llvm::getFnSpecificMDNode(), getModuleFlagsMetadata(), hasDebugInfo(), llvm::makeSubprogramMap(), llvm::DebugInfoFinder::processModule(), and llvm::WinCodeViewLineTables::WinCodeViewLineTables().
GlobalValue * Module::getNamedValue | ( | StringRef | Name | ) | const |
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 70 of file Module.cpp.
References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().
Referenced by forceRenaming(), getComdatGVForCOFF(), getFunction(), getGlobalVariable(), getNamedAlias(), getOrInsertFunction(), getOrInsertGlobal(), and llvm::objcarc::ModuleHasARC().
Comdat * Module::getOrInsertComdat | ( | StringRef | Name | ) |
Return the Comdat in the module with the specified name. It is created if it didn't already exist.
Definition at line 465 of file Module.cpp.
References llvm::CallingConv::C, llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue(), and llvm::StringMapEntry< ValueTy >::second.
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T, | ||
AttributeSet | AttributeList | ||
) |
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 97 of file Module.cpp.
References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::GlobalValue::getType(), llvm::PointerType::getUnqual(), llvm::Function::isIntrinsic(), llvm::iplist< NodeTy, Traits >::push_back(), and llvm::Function::setAttributes().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), createFree(), createMalloc(), llvm::EmitBinaryFloatFnCall(), 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(), llvm::Intrinsic::getDeclaration(), getOrInsertFunction(), insertSinCosCall(), ReplaceCallWith(), and llvm::InstCombiner::visitFPTrunc().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T | ||
) |
Definition at line 120 of file Module.cpp.
References getOrInsertFunction().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
AttributeSet | AttributeList, | ||
Type * | RetTy, | ||
... | |||
) |
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 130 of file Module.cpp.
References llvm::FunctionType::get(), and getOrInsertFunction().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
Type * | RetTy, | ||
... | |||
) |
Same as above, but without the attributes.
Definition at line 149 of file Module.cpp.
References llvm::FunctionType::get(), and getOrInsertFunction().
Constant * Module::getOrInsertGlobal | ( | StringRef | Name, |
Type * | Ty | ||
) |
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 declaration, 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 declaration, return the existing global.
Definition at line 199 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().
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.
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 315 of file Module.cpp.
References getOrInsertNamedMetadata().
Referenced by addModuleFlag().
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 244 of file Module.cpp.
References Name, and llvm::ilist< NodeTy >::push_back().
Referenced by llvm::CloneModule(), llvm::DIBuilder::createCompileUnit(), llvm::getOrInsertFnSpecificMDNode(), and getOrInsertModuleFlagsMetadata().
RandomNumberGenerator & Module::getRNG | ( | ) | const |
Get the RandomNumberGenerator for this module. The RNG can be seeded via -rng-seed=<uint64> and is salted with the ModuleID. The returned RNG should not be shared across threads.
Definition at line 374 of file Module.cpp.
References llvm::sys::path::filename().
static iplist<GlobalVariable> Module::* llvm::Module::getSublistAccess | ( | GlobalVariable * | ) | [inline, static] |
static iplist<Function> Module::* llvm::Module::getSublistAccess | ( | Function * | ) | [inline, static] |
static iplist<GlobalAlias> Module::* llvm::Module::getSublistAccess | ( | GlobalAlias * | ) | [inline, static] |
static ilist<NamedMDNode> Module::* llvm::Module::getSublistAccess | ( | NamedMDNode * | ) | [inline, static] |
const std::string& llvm::Module::getTargetTriple | ( | ) | const [inline] |
Get the target triple which is a string describing the target host.
Definition at line 256 of file Module.h.
Referenced by llvm::CloneModule(), llvm::LTOModule::getTargetTriple(), insertSinCosCall(), llvm::AssemblyWriter::printModule(), llvm::WriteBitcodeToFile(), and WriteModuleInfo().
StructType * Module::getTypeByName | ( | StringRef | Name | ) | const |
Return the type with the specified name, or null if there is none by that name.
getTypeByName - Return the type with the specified name, or null if there is none by that name.
Definition at line 624 of file Type.cpp.
References getContext(), llvm::StringMap< ValueTy, AllocatorTy >::lookup(), llvm::LLVMContextImpl::NamedStructTypes, and llvm::LLVMContext::pImpl.
const ValueSymbolTable& llvm::Module::getValueSymbolTable | ( | ) | const [inline] |
Get the symbol table of global variable and function identifiers.
Definition at line 503 of file Module.h.
Referenced by getNamedValue(), llvm::ValueEnumerator::ValueEnumerator(), and WriteModule().
ValueSymbolTable& llvm::Module::getValueSymbolTable | ( | ) | [inline] |
global_iterator llvm::Module::global_begin | ( | ) | [inline] |
Definition at line 513 of file Module.h.
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetPreviousGlobal(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FindUsedTypes::runOnModule(), StripSymbolNames(), and llvm::ValueEnumerator::ValueEnumerator().
const_global_iterator llvm::Module::global_begin | ( | ) | const [inline] |
bool llvm::Module::global_empty | ( | ) | const [inline] |
Definition at line 517 of file Module.h.
Referenced by llvm::AssemblyWriter::printModule().
global_iterator llvm::Module::global_end | ( | ) | [inline] |
Definition at line 515 of file Module.h.
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::CloneModule(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetNextGlobal(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::FindUsedTypes::runOnModule(), StripSymbolNames(), and llvm::ValueEnumerator::ValueEnumerator().
const_global_iterator llvm::Module::global_end | ( | ) | const [inline] |
iterator_range<global_iterator> llvm::Module::globals | ( | ) | [inline] |
Definition at line 519 of file Module.h.
Referenced by llvm::AsmPrinter::doFinalization(), dropAllReferences(), llvm::ExecutionEngine::emitGlobals(), orderModule(), predictUseListOrder(), and WriteModuleInfo().
iterator_range<const_global_iterator> llvm::Module::globals | ( | ) | const [inline] |
bool Module::isDematerializable | ( | const GlobalValue * | GV | ) | const |
Returns true if this GV was loaded from this Module's GVMaterializer and the GVMaterializer knows how to dematerialize the GV.
Definition at line 398 of file Module.cpp.
Referenced by llvm::GlobalValue::isDematerializable().
bool Module::isMaterializable | ( | const GlobalValue * | GV | ) | const |
True if the definition of GV has yet to be materializedfrom the GVMaterializer.
Definition at line 392 of file Module.cpp.
Referenced by llvm::GlobalValue::isMaterializable().
bool Module::isValidModFlagBehavior | ( | Value * | V, |
ModFlagBehavior & | MFB | ||
) | [static] |
Checks if Value represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition at line 262 of file Module.cpp.
References ModFlagBehaviorFirstVal, and ModFlagBehaviorLastVal.
Referenced by getModuleFlagsMetadata().
bool Module::Materialize | ( | GlobalValue * | GV, |
std::string * | ErrInfo = nullptr |
||
) |
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 404 of file Module.cpp.
Referenced by llvm::GlobalValue::Materialize().
std::error_code Module::materializeAll | ( | ) |
Make sure all GlobalValues in this Module are fully read.
Definition at line 421 of file Module.cpp.
Referenced by materializeAllPermanently().
std::error_code Module::materializeAllPermanently | ( | ) |
Make sure all GlobalValues in this Module are fully read and clear the Materializer. If the module is corrupt, this DOES NOT clear the old Materializer.
Definition at line 427 of file Module.cpp.
References materializeAll().
Referenced by llvm::parseBitcodeFile().
Definition at line 570 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
iterator_range<const_named_metadata_iterator> llvm::Module::named_metadata | ( | ) | const [inline] |
Definition at line 574 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
Definition at line 557 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::StripDebugInfo(), and WriteModuleMetadata().
const_named_metadata_iterator llvm::Module::named_metadata_begin | ( | ) | const [inline] |
Definition at line 558 of file Module.h.
References llvm::iplist< NodeTy, Traits >::begin().
bool llvm::Module::named_metadata_empty | ( | ) | const [inline] |
Definition at line 568 of file Module.h.
Referenced by llvm::AssemblyWriter::printModule().
named_metadata_iterator llvm::Module::named_metadata_end | ( | ) | [inline] |
Definition at line 562 of file Module.h.
References llvm::iplist< NodeTy, Traits >::rbegin().
Referenced by llvm::CloneModule(), llvm::AssemblyWriter::printModule(), llvm::TypeFinder::run(), llvm::StripDebugInfo(), and WriteModuleMetadata().
const_named_metadata_iterator llvm::Module::named_metadata_end | ( | ) | const [inline] |
Definition at line 563 of file Module.h.
References llvm::iplist< NodeTy, Traits >::rbegin().
size_t llvm::Module::named_metadata_size | ( | ) | const [inline] |
Definition at line 567 of file Module.h.
References llvm::iplist< NodeTy, Traits >::empty().
void Module::print | ( | raw_ostream & | OS, |
AssemblyAnnotationWriter * | AAW | ||
) | const |
Print the module to an output stream with an optional AssemblyAnnotationWriter.
Definition at line 2442 of file AsmWriter.cpp.
References llvm::AssemblyWriter::printModule().
Referenced by dump(), and llvm::operator<<().
reverse_iterator llvm::Module::rbegin | ( | ) | [inline] |
Definition at line 532 of file Module.h.
Referenced by predictUseListOrder().
const_reverse_iterator llvm::Module::rbegin | ( | ) | const [inline] |
reverse_iterator llvm::Module::rend | ( | ) | [inline] |
Definition at line 534 of file Module.h.
Referenced by predictUseListOrder().
const_reverse_iterator llvm::Module::rend | ( | ) | const [inline] |
void Module::setDataLayout | ( | StringRef | Desc | ) |
Set the data layout.
Definition at line 344 of file Module.cpp.
References llvm::StringRef::empty(), llvm::DataLayout::getStringRepresentation(), and llvm::DataLayout::reset().
Referenced by llvm::CloneModule(), llvm::MCJIT::emitObject(), and LLVMTargetMachineEmit().
void Module::setDataLayout | ( | const DataLayout * | Other | ) |
Definition at line 356 of file Module.cpp.
References llvm::DataLayout::getStringRepresentation(), and llvm::DataLayout::reset().
void Module::setMaterializer | ( | GVMaterializer * | GVM | ) |
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 385 of file Module.cpp.
Referenced by getLazyBitcodeModuleImpl(), and llvm::getStreamedBitcodeModule().
void llvm::Module::setModuleIdentifier | ( | StringRef | ID | ) | [inline] |
void llvm::Module::setModuleInlineAsm | ( | StringRef | Asm | ) | [inline] |
Set the module-scope inline assembly blocks.
Definition at line 284 of file Module.h.
Referenced by llvm::CloneModule().
void llvm::Module::setTargetTriple | ( | StringRef | T | ) | [inline] |
Set the target triple.
Definition at line 281 of file Module.h.
Referenced by llvm::CloneModule(), and llvm::LTOModule::setTargetTriple().
size_t llvm::Module::size | ( | ) | const [inline] |