|
LLVM
5.0.0
|
A Module instance is used to store all the information related to an LLVM module. More...
#include "llvm/IR/Module.h"
Classes | |
| class | debug_compile_units_iterator |
| An iterator for DICompileUnits that skips those marked NoDebug. More... | |
| struct | ModuleFlagEntry |
Public Member Functions | |
| void | dropTriviallyDeadConstantArrays () |
| Destroy ConstantArrays in LLVMContext if they are not used. More... | |
| void | setOwnedMemoryBuffer (std::unique_ptr< MemoryBuffer > MB) |
| Take ownership of the given memory buffer. More... | |
Constructors | |
| Module (StringRef ModuleID, LLVMContext &C) | |
| The Module constructor. More... | |
| ~Module () | |
| The module destructor. This will dropAllReferences. More... | |
Module Level Accessors | |
| const std::string & | getModuleIdentifier () const |
| Get the module identifier which is, essentially, the name of the module. More... | |
| const std::string & | getSourceFileName () const |
| Get the module's original source file name. More... | |
| StringRef | getName () const |
| Get a short "name" for the module. More... | |
| const std::string & | getDataLayoutStr () const |
| Get the data layout string for the module's target platform. More... | |
| const DataLayout & | getDataLayout () const |
| Get the data layout for the module's target platform. More... | |
| const std::string & | getTargetTriple () const |
| Get the target triple which is a string describing the target host. More... | |
| LLVMContext & | getContext () const |
| Get the global data context. More... | |
| const std::string & | getModuleInlineAsm () const |
| Get any module-scope inline assembly blocks. More... | |
| std::unique_ptr < RandomNumberGenerator > | createRNG (const Pass *P) const |
| Get a RandomNumberGenerator salted for use with this module. More... | |
Module Level Mutators | |
| void | setModuleIdentifier (StringRef ID) |
| Set the module identifier. More... | |
| void | setSourceFileName (StringRef Name) |
| Set the module's original source file name. More... | |
| void | setDataLayout (StringRef Desc) |
| Set the data layout. More... | |
| void | setDataLayout (const DataLayout &Other) |
| void | setTargetTriple (StringRef T) |
| Set the target triple. More... | |
| void | setModuleInlineAsm (StringRef Asm) |
| Set the module-scope inline assembly blocks. More... | |
| void | appendModuleInlineAsm (StringRef Asm) |
| Append to the module-scope inline assembly blocks. More... | |
Generic Value Accessors | |
| GlobalValue * | getNamedValue (StringRef Name) const |
| Return the global value in the module with the specified name, of arbitrary type. More... | |
| unsigned | getMDKindID (StringRef Name) const |
| Return a unique non-zero ID for the specified metadata kind. More... | |
| void | getMDKindNames (SmallVectorImpl< StringRef > &Result) const |
| Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext. More... | |
| void | getOperandBundleTags (SmallVectorImpl< StringRef > &Result) const |
| Populate client supplied SmallVector with the bundle tags registered in this LLVMContext. More... | |
| StructType * | getTypeByName (StringRef Name) const |
| Return the type with the specified name, or null if there is none by that name. More... | |
| std::vector< StructType * > | getIdentifiedStructTypes () const |
Function Accessors | |
| Constant * | getOrInsertFunction (StringRef Name, FunctionType *T, AttributeList AttributeList) |
| Look up the specified function in the module symbol table. More... | |
| Constant * | getOrInsertFunction (StringRef Name, FunctionType *T) |
| template<typename... ArgsTy> | |
| Constant * | getOrInsertFunction (StringRef Name, AttributeList AttributeList, Type *RetTy, ArgsTy...Args) |
| Look up the specified function in the module symbol table. More... | |
| template<typename... ArgsTy> | |
| Constant * | getOrInsertFunction (StringRef Name, Type *RetTy, ArgsTy...Args) |
| Same as above, but without the attributes. More... | |
| Function * | getFunction (StringRef Name) const |
| Look up the specified function in the module symbol table. More... | |
Global Variable Accessors | |
| GlobalVariable * | getGlobalVariable (StringRef Name) const |
| Look up the specified global variable in the module symbol table. More... | |
| GlobalVariable * | getGlobalVariable (StringRef Name, bool AllowInternal) const |
| getGlobalVariable - Look up the specified global variable in the module symbol table. More... | |
| GlobalVariable * | getGlobalVariable (StringRef Name, bool AllowInternal=false) |
| const GlobalVariable * | getNamedGlobal (StringRef Name) const |
| Return the global variable in the module with the specified name, of arbitrary type. More... | |
| GlobalVariable * | getNamedGlobal (StringRef Name) |
| Constant * | getOrInsertGlobal (StringRef Name, Type *Ty) |
| Look up the specified global in the module symbol table. More... | |
Global Alias Accessors | |
| GlobalAlias * | getNamedAlias (StringRef Name) const |
| Return the global alias in the module with the specified name, of arbitrary type. More... | |
Global IFunc Accessors | |
| GlobalIFunc * | getNamedIFunc (StringRef Name) const |
| Return the global ifunc in the module with the specified name, of arbitrary type. More... | |
Named Metadata Accessors | |
| NamedMDNode * | getNamedMetadata (const Twine &Name) const |
| Return the first NamedMDNode in the module with the specified name. More... | |
| NamedMDNode * | getOrInsertNamedMetadata (StringRef Name) |
| Return the named MDNode in the module with the specified name. More... | |
| void | eraseNamedMetadata (NamedMDNode *NMD) |
| Remove the given NamedMDNode from this module and delete it. More... | |
Comdat Accessors | |
| Comdat * | getOrInsertComdat (StringRef Name) |
| Return the Comdat in the module with the specified name. More... | |
Module Flags Accessors | |
| void | getModuleFlagsMetadata (SmallVectorImpl< ModuleFlagEntry > &Flags) const |
| Returns the module flags in the provided vector. More... | |
| Metadata * | getModuleFlag (StringRef Key) const |
| Return the corresponding value if Key appears in module flags, otherwise return null. More... | |
| NamedMDNode * | getModuleFlagsMetadata () const |
| Returns the NamedMDNode in the module that represents module-level flags. More... | |
| NamedMDNode * | getOrInsertModuleFlagsMetadata () |
| Returns the NamedMDNode in the module that represents module-level flags. More... | |
| void | addModuleFlag (ModFlagBehavior Behavior, StringRef Key, Metadata *Val) |
| Add a module-level flag to the module-level flags metadata. More... | |
| void | addModuleFlag (ModFlagBehavior Behavior, StringRef Key, Constant *Val) |
| void | addModuleFlag (ModFlagBehavior Behavior, StringRef Key, uint32_t Val) |
| void | addModuleFlag (MDNode *Node) |
Materialization | |
| void | setMaterializer (GVMaterializer *GVM) |
| Sets the GVMaterializer to GVM. More... | |
| GVMaterializer * | getMaterializer () const |
| Retrieves the GVMaterializer, if any, for this Module. More... | |
| bool | isMaterialized () const |
| llvm::Error | materialize (GlobalValue *GV) |
| Make sure the GlobalValue is fully read. More... | |
| llvm::Error | materializeAll () |
| Make sure all GlobalValues in this Module are fully read and clear the Materializer. More... | |
| llvm::Error | materializeMetadata () |
Global Variable Iteration | |
| global_iterator | global_begin () |
| const_global_iterator | global_begin () const |
| global_iterator | global_end () |
| const_global_iterator | global_end () const |
| bool | global_empty () const |
| iterator_range< global_iterator > | globals () |
| iterator_range < const_global_iterator > | globals () const |
Function Iteration | |
| 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 |
| iterator_range< iterator > | functions () |
| iterator_range< const_iterator > | functions () const |
Alias Iteration | |
| alias_iterator | alias_begin () |
| const_alias_iterator | alias_begin () const |
| alias_iterator | alias_end () |
| const_alias_iterator | alias_end () const |
| size_t | alias_size () const |
| bool | alias_empty () const |
| iterator_range< alias_iterator > | aliases () |
| iterator_range < const_alias_iterator > | aliases () const |
IFunc Iteration | |
| ifunc_iterator | ifunc_begin () |
| const_ifunc_iterator | ifunc_begin () const |
| ifunc_iterator | ifunc_end () |
| const_ifunc_iterator | ifunc_end () const |
| size_t | ifunc_size () const |
| bool | ifunc_empty () const |
| iterator_range< ifunc_iterator > | ifuncs () |
| iterator_range < const_ifunc_iterator > | ifuncs () const |
Named Metadata Iteration | |
| named_metadata_iterator | named_metadata_begin () |
| const_named_metadata_iterator | named_metadata_begin () const |
| named_metadata_iterator | named_metadata_end () |
| const_named_metadata_iterator | named_metadata_end () const |
| size_t | named_metadata_size () const |
| bool | named_metadata_empty () const |
| iterator_range < named_metadata_iterator > | named_metadata () |
| iterator_range < const_named_metadata_iterator > | named_metadata () const |
| debug_compile_units_iterator | debug_compile_units_begin () const |
| debug_compile_units_iterator | debug_compile_units_end () const |
| iterator_range < debug_compile_units_iterator > | debug_compile_units () const |
| Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and aren't explicitly marked as NoDebug. More... | |
Utility functions for printing and dumping Module objects | |
| void | print (raw_ostream &OS, AssemblyAnnotationWriter *AAW, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const |
| Print the module to an output stream with an optional AssemblyAnnotationWriter. More... | |
| void | dump () const |
| Dump the module to stderr (for debugging). More... | |
| void | dropAllReferences () |
| This function causes all the subinstructions to "let go" of all references that they are maintaining. More... | |
Utility functions for querying Debug information. | |
| unsigned | getNumberRegisterParameters () const |
| Returns the Number of Register ParametersDwarf Version by checking module flags. More... | |
| unsigned | getDwarfVersion () const |
| Returns the Dwarf Version by checking module flags. More... | |
| unsigned | getCodeViewFlag () const |
| Returns the CodeView Version by checking module flags. More... | |
Utility functions for querying and setting PIC level | |
| PICLevel::Level | getPICLevel () const |
| Returns the PIC level (small or large model) More... | |
| void | setPICLevel (PICLevel::Level PL) |
| Set the PIC level (small or large model) More... | |
Utility functions for querying and setting PIE level | |
| PIELevel::Level | getPIELevel () const |
| Returns the PIE level (small or large model) More... | |
| void | setPIELevel (PIELevel::Level PL) |
| Set the PIE level (small or large model) More... | |
Utility functions for querying and setting PGO summary | |
| void | setProfileSummary (Metadata *M) |
| Attach profile summary metadata to this module. More... | |
| Metadata * | getProfileSummary () |
| Returns profile summary metadata. More... | |
Member Variables | |
| class | Constant |
Direct access to the globals list, functions list, and symbol table | |
| static GlobalListType Module::* | getSublistAccess (GlobalVariable *) |
| static FunctionListType Module::* | getSublistAccess (Function *) |
| static AliasListType Module::* | getSublistAccess (GlobalAlias *) |
| static IFuncListType Module::* | getSublistAccess (GlobalIFunc *) |
| static NamedMDListType Module::* | getSublistAccess (NamedMDNode *) |
| 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 IFuncListType & | getIFuncList () const |
| Get the Module's list of ifuncs (constant). More... | |
| IFuncListType & | getIFuncList () |
| Get the Module's list of ifuncs. 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... | |
| const ComdatSymTabType & | getComdatSymbolTable () const |
| Get the Module's symbol table for COMDATs (constant). More... | |
| ComdatSymTabType & | getComdatSymbolTable () |
| Get the Module's symbol table for COMDATs. More... | |
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. The main container class for the LLVM Intermediate Representation.
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 72 of file Module.cpp.
| Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 79 of file Module.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::clear(), and dropAllReferences().
| void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
| StringRef | Key, | ||
| Metadata * | Val | ||
| ) |
Add a module-level flag to the module-level flags metadata.
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 329 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDString::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), getOrInsertModuleFlagsMetadata(), and Int32Ty.
Referenced by addModuleFlag(), llvm::orc::cloneModuleFlagsMetadata(), setPICLevel(), setPIELevel(), setProfileSummary(), and llvm::UpgradeModuleFlags().
| void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
| StringRef | Key, | ||
| Constant * | Val | ||
| ) |
Definition at line 337 of file Module.cpp.
References addModuleFlag(), and llvm::ConstantAsMetadata::get().
| void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
| StringRef | Key, | ||
| uint32_t | Val | ||
| ) |
Definition at line 341 of file Module.cpp.
References addModuleFlag(), llvm::ConstantInt::get(), llvm::Type::getInt32Ty(), and Int32Ty.
| void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 346 of file Module.cpp.
References llvm::NamedMDNode::addOperand(), assert(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and getOrInsertModuleFlagsMetadata().
|
inline |
Definition at line 594 of file Module.h.
Referenced by aliases(), findPartitions(), OptimizeGlobalAliases(), and llvm::TypeFinder::run().
|
inline |
|
inline |
Definition at line 596 of file Module.h.
Referenced by aliases(), findPartitions(), OptimizeGlobalAliases(), and llvm::TypeFinder::run().
|
inline |
|
inline |
Definition at line 598 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doInitialization().
|
inline |
Definition at line 601 of file Module.h.
References alias_begin(), alias_end(), and llvm::make_range().
Referenced by dropAllReferences(), llvm::filterDeadComdatFunctions(), global_values(), llvm::nameUnamedGlobals(), and orderModule().
|
inline |
Definition at line 604 of file Module.h.
References alias_begin(), alias_end(), and llvm::make_range().
|
inline |
Append to the module-scope inline assembly blocks.
A trailing newline is added if the input doesn't have one.
Definition at line 281 of file Module.h.
References llvm::HexStyle::Asm.
|
inline |
Definition at line 572 of file Module.h.
Referenced by findPartitions(), functions(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetPreviousFunction(), OptimizeFunctions(), llvm::DeadArgumentEliminationPass::run(), stripDeadPrototypes(), and llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit().
|
inline |
| std::unique_ptr< RandomNumberGenerator > Module::createRNG | ( | const Pass * | P | ) | const |
Get a RandomNumberGenerator salted for use with this module.
The RNG can be seeded via -rng-seed=<uint64> and is salted with the ModuleID and the provided pass salt. The returned RNG should not be shared across threads or passes.
A unique RNG per pass ensures a reproducible random stream even when other randomness consuming passes are added or removed. In addition, the random stream will be reproducible across LLVM versions when the pass does not change.
Definition at line 91 of file Module.cpp.
References llvm::sys::path::filename(), getModuleIdentifier(), and llvm::Pass::getPassName().
|
inline |
Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and aren't explicitly marked as NoDebug.
Definition at line 755 of file Module.h.
References getNamedMetadata(), and llvm::make_range().
Referenced by llvm::DwarfDebug::beginModule(), and llvm::DebugInfoFinder::processModule().
|
inline |
Definition at line 742 of file Module.h.
References getNamedMetadata().
Referenced by llvm::DwarfDebug::beginModule().
|
inline |
Definition at line 747 of file Module.h.
References getNamedMetadata().
Referenced by llvm::DwarfDebug::beginModule().
| 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 431 of file Module.cpp.
References aliases(), llvm::Function::dropAllReferences(), F, globals(), and ifuncs().
Referenced by ~Module().
| void Module::dropTriviallyDeadConstantArrays | ( | ) |
Destroy ConstantArrays in LLVMContext if they are not used.
ConstantArrays constructed during linking can cause quadratic memory explosion. Releasing all unused constants can cause a 20% LTO compile-time slowdown for a large application.
NOTE: Constants are currently owned by LLVMContext. This can then only be called where all uses of the LLVMContext are understood.
Definition at line 151 of file LLVMContextImpl.cpp.
References llvm::LLVMContextImpl::dropTriviallyDeadConstantArrays(), and llvm::LLVMContext::pImpl.
Referenced by llvm::IRMover::move().
| LLVM_DUMP_METHOD void Module::dump | ( | ) | const |
Dump the module to stderr (for debugging).
Definition at line 3614 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 574 of file Module.h.
Referenced by findPartitions(), functions(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetNextFunction(), OptimizeFunctions(), llvm::DeadArgumentEliminationPass::run(), stripDeadPrototypes(), and llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit().
|
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 264 of file Module.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::NamedMDNode::getName().
Referenced by llvm::NamedMDNode::eraseFromParent().
|
inline |
Definition at line 583 of file Module.h.
References begin(), end(), and llvm::make_range().
Referenced by llvm::filterDeadComdatFunctions(), global_objects(), global_values(), inferAllPrototypeAttributes(), llvm::DebugInfoFinder::processModule(), llvm::ForceFunctionAttrsPass::run(), llvm::PrintModulePass::run(), and llvm::ImportedFunctionsInliningStatistics::setModuleInfo().
|
inline |
Definition at line 586 of file Module.h.
References begin(), end(), and llvm::make_range().
|
inline |
Get the Module's list of aliases (constant).
Definition at line 515 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent(), OptimizeGlobalAliases(), and llvm::GlobalAlias::removeFromParent().
|
inline |
| unsigned Module::getCodeViewFlag | ( | ) | const |
Returns the CodeView Version by checking module flags.
Returns zero if not present in module.
Definition at line 460 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::AsmPrinter::doInitialization().
|
inline |
Get the Module's symbol table for COMDATs (constant).
Definition at line 547 of file Module.h.
Referenced by llvm::InternalizePass::internalizeModule(), and rewriteComdat().
|
inline |
|
inline |
Get the global data context.
Definition at line 237 of file Module.h.
References Context.
Referenced by llvm::LTOCodeGenerator::addModule(), llvm::IntrinsicLowering::AddPrototypes(), annotateAllFunctions(), llvm::annotateValueSite(), appendToGlobalArray(), appendToUsedList(), assureFPCallStub(), llvm::CloneModule(), createDevirtTriggerFunc(), createDummyFunction(), createFPFnStub(), createFree(), CreateGCRelocates(), createIRLevelProfileFlagVariable(), llvm::createPGOFuncNameVar(), createPrivateGlobalForSourceLoc(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::createSanitizerCtorAndInitFunctions(), CreateWrapper(), llvm::declareSanitizerInitFunction(), doImportingForModule(), EmitGCCInlineAsmStr(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::emitMemCpyChk(), EmitMSInlineAsmStr(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), EnsureFPIntrinsicsExist(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::objcarc::ARCMDKindCache::get(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::TargetLoweringBase::getIRStackGuard(), getOrInsertValueProfilingCall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::InstrProfIncrementInst::getStep(), getTypeByName(), llvm::FunctionImporter::importFunctions(), InsertSafepointPoll(), llvm::X86TargetLowering::insertSSPDeclarations(), llvm::TargetLoweringBase::insertSSPDeclarations(), insertUseHolderAfter(), llvm::VerifierPass::run(), llvm::legacy::PassManagerImpl::run(), llvm::Float2IntPass::runImpl(), llvm::SanitizerStatReport::SanitizerStatReport(), llvm::setProfMetadata(), llvm::ModulePass::skipModule(), llvm::CallGraphSCCPass::skipSCC(), llvm::stripNonLineTableDebugInfo(), SwitchToLookupTable(), llvm::lto::thinBackend(), llvm::UpgradeDebugInfo(), llvm::UpgradeModuleFlags(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().
| const DataLayout & Module::getDataLayout | ( | ) | const |
Get the data layout for the module's target platform.
Definition at line 361 of file Module.cpp.
Referenced by llvm::AliasSetTracker::add(), AddAlignmentAssumptions(), llvm::IVUsers::AddUsersImpl(), allCallersPassInValidPointerForArgument(), llvm::GlobalsAAResult::analyzeModule(), llvm::AAResults::callCapturesBefore(), llvm::objcarc::CanAlterRefCount(), llvm::canSinkOrHoistInst(), llvm::objcarc::CanUse(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneModule(), llvm::FunctionComparator::cmpTypes(), combineInstructionsOverFunction(), llvm::ComputeLegalValueVTs(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessors(), llvm::ConstantFoldCall(), llvm::ConvertDebugDeclareToDebugValue(), llvm::SanitizerStatReport::create(), llvm::IRBuilder< TargetFolder >::CreateAlloca(), llvm::createLegacyPMBasicAAResult(), createMaskInstrs(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DependenceInfo::depends(), llvm::objcarc::ObjCARCAAWrapperPass::doInitialization(), llvm::AMDGPUAAWrapperPass::doInitialization(), doPromotion(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), eliminateTailRecursion(), llvm::AsmPrinter::EmitAlignment(), emitCalloc(), EmitCamlGlobal(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::emitLinkerFlagsForGlobalCOFF(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailablePtrLoadStore(), findLoadCallsAtConstantOffset(), llvm::MCJIT::generateCodeForModule(), llvm::MemoryLocation::get(), getAlignment(), llvm::getBestSimplifyQuery(), llvm::LazyValueInfo::getConstant(), llvm::getConstantDataArrayInfo(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRange(), llvm::LazyValueInfo::getConstantRangeOnEdge(), llvm::AsmPrinter::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::DemandedBits::getDemandedBits(), llvm::getGEPInductionOperand(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::MemoryDependenceResults::getLoadLoadClobberFullWidthSize(), llvm::ExecutionEngine::getMangledName(), llvm::Mangler::getNameWithPrefix(), llvm::LazyValueInfo::getPredicateAt(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::NVPTXTargetLowering::getPrototype(), llvm::TargetLoweringObjectFile::getSectionForJumpTable(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::DependenceInfo::getSplitIteration(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::MipsTargetMachine::getTargetIRAnalysis(), llvm::TargetMachine::getTargetIRAnalysis(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::CallLowering::handleAssignments(), HandleByValArgument(), HandleByValArgumentInit(), handleEndBlock(), handleFree(), llvm::hoistRegion(), llvm::DataLayout::init(), INITIALIZE_PASS(), llvm::InlineFunction(), llvm::InductionDescriptor::isInductionPHI(), isLoadInvariantInLoop(), isObjectDereferencedInBlock(), isPointerValueDeadOnEntryToFunction(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), llvm::isSafeToSpeculativelyExecute(), IsSmallObject(), llvm::AArch64CallLowering::lowerCall(), llvm::CallLowering::lowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::AArch64CallLowering::lowerReturn(), llvm::gvn::AvailableValue::MaterializeAdjustedValue(), mergeInlinedArrayAllocas(), OptimizeGlobalVars(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processInternalGlobal(), promoteArguments(), llvm::promoteLoopAccessesToScalars(), relocationViaAlloca(), replaceAndRecursivelySimplifyImpl(), replaceFrameSize(), llvm::returnTypeIsEligibleForTailCall(), llvm::NewGVNPass::run(), llvm::IndVarSimplifyPass::run(), llvm::InstSimplifierPass::run(), llvm::GlobalOptPass::run(), llvm::IPSCCPPass::run(), llvm::SCCPPass::run(), llvm::EarlyCSEPass::run(), llvm::AMDGPUAA::run(), llvm::objcarc::ObjCARCAA::run(), llvm::LazyValueAnalysis::run(), llvm::BasicAA::run(), llvm::SLPVectorizerPass::runImpl(), llvm::NaryReassociatePass::runImpl(), llvm::LazyValueInfoWrapperPass::runOnFunction(), llvm::BasicAAWrapperPass::runOnFunction(), llvm::IRTranslator::runOnMachineFunction(), selectELFSectionForGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), llvm::HexagonTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::SimplifyCFG(), llvm::SimplifyInstructionsInBlock(), llvm::LazyValueInfo::threadEdge(), llvm::JumpThreadingPass::ThreadGuard(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), llvm::orc::CompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::updatePointer(), llvm::LoopVersioning::versionLoop(), and visitIVCast().
|
inline |
Get the data layout string for the module's target platform.
This is equivalent to getDataLayout()->getStringRepresentation().
Definition at line 224 of file Module.h.
References llvm::DL, and llvm::DataLayout::getStringRepresentation().
| unsigned Module::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version by checking module flags.
Definition at line 453 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::AsmPrinter::doInitialization(), and llvm::DwarfDebug::DwarfDebug().
Look up the specified function in the module symbol table.
If it does not exist, return null.
Definition at line 172 of file Module.cpp.
References getNamedValue().
Referenced by assureFPCallStub(), createDevirtTriggerFunc(), llvm::emitFPutC(), llvm::emitFPutS(), llvm::emitFWrite(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitPutChar(), llvm::emitPutS(), llvm::emitStrChr(), llvm::emitStrCpy(), llvm::emitStrLen(), llvm::emitStrNCmp(), llvm::emitStrNCpy(), FindCXAAtExit(), llvm::sampleprof::FunctionSamples::findImportedFunctions(), llvm::MCJIT::findModuleForSymbol(), llvm::SparcTargetLowering::getSRetArgSize(), llvm::X86TargetLowering::getSSPStackGuardCheck(), hasReturnsTwiceAttr(), InsertSafepointPoll(), lowerGuardIntrinsic(), llvm::MIRParserImpl::parseMachineFunction(), prepareForSplit(), llvm::MachineInstr::print(), replaceDevirtTrigger(), llvm::JumpThreadingPass::runImpl(), llvm::ScalarEvolution::ScalarEvolution(), and llvm::stripNonLineTableDebugInfo().
|
inline |
Get the Module's list of functions (constant).
Definition at line 507 of file Module.h.
Referenced by llvm::AsmPrinter::doInitialization(), doPromotion(), llvm::Function::eraseFromParent(), llvm::Function::removeFromParent(), and llvm::CallGraph::removeFunctionFromModule().
|
inline |
|
inline |
Get the Module's list of global variables (constant).
Definition at line 498 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doFinalization(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalVariable::GlobalVariable(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalVariable::removeFromParent(), SRAGlobal(), and TryToShrinkGlobalToBoolean().
|
inline |
|
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 368 of file Module.h.
Referenced by appendToUsedList(), llvm::collectUsedGlobalVariables(), llvm::MCJIT::findModuleForSymbol(), getGlobalVariable(), getNamedGlobal(), llvm::X86TargetLowering::getSDagStackGuard(), llvm::TargetLoweringBase::getSDagStackGuard(), mergeConstants(), and StripSymbolNames().
| GlobalVariable * Module::getGlobalVariable | ( | StringRef | Name, |
| bool | AllowLocal | ||
| ) | const |
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 187 of file Module.cpp.
References getNamedValue().
|
inline |
Definition at line 374 of file Module.h.
References getGlobalVariable().
| std::vector< StructType * > Module::getIdentifiedStructTypes | ( | ) | const |
Definition at line 410 of file Module.cpp.
References llvm::TypeFinder::begin(), llvm::TypeFinder::end(), llvm::MipsISD::Ret, and llvm::TypeFinder::run().
|
inline |
Get the Module's list of ifuncs (constant).
Definition at line 524 of file Module.h.
Referenced by llvm::GlobalIFunc::eraseFromParent(), and llvm::GlobalIFunc::removeFromParent().
|
inline |
|
inline |
Retrieves the GVMaterializer, if any, for this Module.
Definition at line 481 of file Module.h.
Referenced by isMaterialized().
Return a unique non-zero ID for the specified metadata kind.
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 118 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 125 of file Module.cpp.
References llvm::LLVMContext::getMDKindNames().
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 302 of file Module.cpp.
References getModuleFlagsMetadata().
Referenced by getCodeViewFlag(), llvm::getDebugMetadataVersionFromModule(), getDwarfVersion(), getNumberRegisterParameters(), getPICLevel(), getPIELevel(), getProfileSummary(), and llvm::TargetLibraryInfoImpl::getWCharSize().
| 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 282 of file Module.cpp.
References getModuleFlagsMetadata(), isValidModFlagBehavior(), llvm::NamedMDNode::operands(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::orc::cloneModuleFlagsMetadata(), GetObjCImageInfo(), and llvm::UpgradeModuleFlags().
| NamedMDNode * Module::getModuleFlagsMetadata | ( | ) | const |
Returns the NamedMDNode in the module that represents 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 315 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 208 of file Module.h.
Referenced by llvm::CloneModule(), createRNG(), llvm::ThinLTOCodeGenerator::crossModuleImport(), doImportingForModule(), EmitCamlGlobal(), llvm::ModuleSummaryIndex::hasExportedFunctions(), llvm::FunctionImporter::importFunctions(), llvm::ThinLTOCodeGenerator::internalize(), llvm::LazyCallGraph::LazyCallGraph(), llvm::DiagnosticPrinterRawOStream::operator<<(), llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print(), llvm::ThinLTOCodeGenerator::promote(), llvm::LazyCallGraphPrinterPass::run(), and llvm::LazyCallGraphDOTPrinterPass::run().
|
inline |
Get any module-scope inline assembly blocks.
Definition at line 241 of file Module.h.
Referenced by llvm::CloneModule(), llvm::ModuleSymbolTable::CollectAsmSymbols(), llvm::AsmPrinter::doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), and llvm::X86AsmPrinter::EmitStartOfAsmFile().
|
inline |
Get a short "name" for the module.
This is useful for debugging or logging. It is essentially a convenience wrapper around getModuleIdentifier().
Definition at line 220 of file Module.h.
Referenced by getDescription(), llvm::getPGOFuncName(), llvm::ProfileSummaryPrinterPass::run(), and llvm::ImportedFunctionsInliningStatistics::setModuleInfo().
| 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 231 of file Module.cpp.
References getNamedValue().
|
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 383 of file Module.h.
References getGlobalVariable().
Referenced by appendToGlobalArray(), createGlobalValueName(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::orc::getConstructors(), llvm::orc::getDestructors(), getNamedGlobal(), llvm::isIRPGOFlagSet(), llvm::TargetLowering::LowerToTLSEmulatedModel(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().
|
inline |
Definition at line 386 of file Module.h.
References getNamedGlobal().
| GlobalIFunc * Module::getNamedIFunc | ( | StringRef | Name | ) | const |
Return the global ifunc 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 235 of file Module.cpp.
References getNamedValue().
|
inline |
|
inline |
| NamedMDNode * Module::getNamedMetadata | ( | const Twine & | Name | ) | const |
Return the first NamedMDNode in the module with the specified name.
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 242 of file Module.cpp.
References lookup(), and llvm::Twine::toStringRef().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::cacheAnnotationFromMD(), llvm::CodeViewDebug::CodeViewDebug(), debug_compile_units(), debug_compile_units_begin(), debug_compile_units_end(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), and getModuleFlagsMetadata().
| GlobalValue * Module::getNamedValue | ( | StringRef | Name | ) | const |
Return the global value in the module with the specified name, of arbitrary type.
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 112 of file Module.cpp.
References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().
Referenced by llvm::coro::declaresIntrinsics(), forceRenaming(), getComdatGVForCOFF(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), getFunction(), getGlobalVariable(), getNamedAlias(), getNamedIFunc(), getOrInsertFunction(), getOrInsertGlobal(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::X86InstrInfo::insertOutlinedCall(), and llvm::objcarc::ModuleHasARC().
| unsigned Module::getNumberRegisterParameters | ( | ) | const |
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition at line 445 of file Module.cpp.
References getModuleFlag().
| void Module::getOperandBundleTags | ( | SmallVectorImpl< StringRef > & | Result | ) | const |
Populate client supplied SmallVector with the bundle tags registered in this LLVMContext.
The bundle tags are ordered by increasing bundle IDs.
Definition at line 129 of file Module.cpp.
References llvm::LLVMContext::getOperandBundleTags().
Return the Comdat in the module with the specified name.
It is created if it didn't already exist.
Definition at line 467 of file Module.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::insert().
Referenced by copyComdat(), createIRLevelProfileFlagVariable(), getOrCreateProfileComdat(), and rewriteComdat().
| Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
| FunctionType * | T, | ||
| AttributeList | AttributeList | ||
| ) |
Look up the specified function in the module symbol table.
Four possibilities:
Definition at line 142 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_impl< IntrusiveListT, TraitsT >::push_back(), and llvm::Function::setAttributes().
Referenced by llvm::SanitizerStatReport::create(), createDummyFunction(), createFree(), createMalloc(), llvm::createSanitizerCtorAndInitFunctions(), llvm::declareSanitizerInitFunction(), llvm::emitBinaryFloatFnCall(), emitCalloc(), 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::emitUnaryFloatFnCall(), EnsureFunctionExists(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), getOrInsertFunction(), getOrInsertValueProfilingCall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), insertSinCosCall(), llvm::X86TargetLowering::insertSSPDeclarations(), insertUseHolderAfter(), and ReplaceCallWith().
| Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
| FunctionType * | T | ||
| ) |
Definition at line 164 of file Module.cpp.
References getOrInsertFunction().
|
inline |
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 list of function arguments, which makes it easier for clients to use.
Definition at line 340 of file Module.h.
References llvm::AMDGPU::CodeObject::Kernel::Key::Args, llvm::FunctionType::get(), and getOrInsertFunction().
|
inline |
Same as above, but without the attributes.
Definition at line 352 of file Module.h.
References llvm::AMDGPU::CodeObject::Kernel::Key::Args, and getOrInsertFunction().
Look up the specified global in the module symbol table.
getOrInsertGlobal - Look up the specified global in the module symbol table.
Definition at line 202 of file Module.cpp.
References llvm::GlobalValue::ExternalLinkage, llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::Type::getPointerAddressSpace(), and llvm::GlobalValue::getType().
Referenced by llvm::TargetLoweringBase::getIRStackGuard(), llvm::X86TargetLowering::insertSSPDeclarations(), and llvm::TargetLoweringBase::insertSSPDeclarations().
| NamedMDNode * Module::getOrInsertModuleFlagsMetadata | ( | ) |
Returns the NamedMDNode in the module that represents module-level flags.
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 322 of file Module.cpp.
References getOrInsertNamedMetadata().
Referenced by addModuleFlag().
| NamedMDNode * Module::getOrInsertNamedMetadata | ( | StringRef | Name | ) |
Return the named MDNode in the module with the specified 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.
Definition at line 251 of file Module.cpp.
References Name, and llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back().
Referenced by llvm::DIBuilder::createCompileUnit(), and getOrInsertModuleFlagsMetadata().
| PICLevel::Level Module::getPICLevel | ( | ) | const |
Returns the PIC level (small or large model)
Definition at line 473 of file Module.cpp.
References getModuleFlag(), and llvm::PICLevel::NotPIC.
| PIELevel::Level Module::getPIELevel | ( | ) | const |
Returns the PIE level (small or large model)
Definition at line 487 of file Module.cpp.
References llvm::PIELevel::Default, and getModuleFlag().
Referenced by llvm::TargetMachine::getTLSModel(), and llvm::TargetMachine::shouldAssumeDSOLocal().
| Metadata * Module::getProfileSummary | ( | ) |
Returns profile summary metadata.
Definition at line 505 of file Module.cpp.
References getModuleFlag().
|
inline |
Get the module's original source file name.
When compiling from bitcode, this is taken from a bitcode record where it was recorded. For other compiles it is the same as the ModuleID, which would contain the source file name.
Definition at line 214 of file Module.h.
Referenced by llvm::AsmPrinter::doInitialization(), llvm::FunctionImporter::importFunctions(), and llvm::thinLTOInternalizeModule().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Get the target triple which is a string describing the target host.
Definition at line 233 of file Module.h.
Referenced by llvm::ModuleSymbolTable::addModule(), llvm::GlobalValue::canIncreaseAlignment(), llvm::CloneModule(), llvm::ThinLTOCodeGenerator::codegen(), llvm::ModuleSymbolTable::CollectAsmSymbols(), createIRLevelProfileFlagVariable(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::AMDGPUAAWrapperPass::doInitialization(), llvm::AMDGPU::getAMDGPUAS(), getDefaultPersonalityFn(), getOrCreateProfileComdat(), llvm::LTOModule::getTargetTriple(), llvm::TargetLibraryInfoImpl::getWCharSize(), insertSinCosCall(), llvm::ThinLTOCodeGenerator::internalize(), isCallingConvCCompatible(), llvm::needsComdatForCounter(), needsRuntimeRegistrationOfSectionRange(), llvm::ThinLTOCodeGenerator::optimize(), llvm::ThinLTOCodeGenerator::promote(), llvm::InstrProfiling::run(), llvm::AMDGPUAA::run(), llvm::TargetLibraryAnalysis::run(), shouldInstrumentReadWriteFromAddress(), and llvm::WriteBitcodeToFile().
| StructType * Module::getTypeByName | ( | StringRef | Name | ) | const |
Return the type with the specified name, or null if there is none by that name.
Definition at line 509 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 542 of file Module.h.
Referenced by getNamedValue().
|
inline |
|
inline |
Definition at line 555 of file Module.h.
Referenced by llvm::CloneModule(), findPartitions(), globals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetPreviousGlobal(), mergeConstants(), OptimizeGlobalVars(), llvm::TypeFinder::run(), stripDeadPrototypes(), and StripSymbolNames().
|
inline |
|
inline |
Definition at line 557 of file Module.h.
Referenced by llvm::CloneModule(), findPartitions(), globals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetNextGlobal(), mergeConstants(), OptimizeGlobalVars(), llvm::TypeFinder::run(), stripDeadPrototypes(), and StripSymbolNames().
|
inline |
|
inline |
Definition at line 643 of file Module.h.
References global_objects().
|
inline |
Definition at line 648 of file Module.h.
References global_objects().
|
inline |
Definition at line 646 of file Module.h.
References global_objects().
|
inline |
Definition at line 651 of file Module.h.
References global_objects().
|
inline |
Definition at line 636 of file Module.h.
References functions(), and globals().
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), global_object_begin(), global_object_end(), and llvm::nameUnamedGlobals().
|
inline |
Definition at line 639 of file Module.h.
References functions(), and globals().
|
inline |
Definition at line 670 of file Module.h.
References global_values().
|
inline |
Definition at line 673 of file Module.h.
References global_values().
|
inline |
Definition at line 671 of file Module.h.
References global_values().
|
inline |
Definition at line 676 of file Module.h.
References global_values().
|
inline |
Definition at line 662 of file Module.h.
References aliases(), functions(), globals(), and ifuncs().
Referenced by llvm::ModuleSymbolTable::addModule(), global_value_begin(), and global_value_end().
|
inline |
|
inline |
Definition at line 561 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
Referenced by llvm::DwarfDebug::beginModule(), llvm::AsmPrinter::computeGlobalGOTEquivs(), llvm::AsmPrinter::doFinalization(), dropAllReferences(), eliminateAvailableExternally(), llvm::ExecutionEngine::emitGlobals(), llvm::filterDeadComdatFunctions(), global_objects(), global_values(), optimizeGlobalsInModule(), orderModule(), predictUseListOrder(), llvm::stripNonLineTableDebugInfo(), and llvm::ValueEnumerator::ValueEnumerator().
|
inline |
Definition at line 564 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 619 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
Referenced by dropAllReferences(), global_values(), and orderModule().
|
inline |
Definition at line 622 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
|
inline |
Definition at line 482 of file Module.h.
References getMaterializer().
Referenced by llvm::Value::assertModuleIsMaterializedImpl(), and llvm::BitcodeWriter::writeModule().
|
static |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition at line 269 of file Module.cpp.
References ModFlagBehaviorFirstVal, and ModFlagBehaviorLastVal.
Referenced by getModuleFlagsMetadata().
| Error Module::materialize | ( | GlobalValue * | GV | ) |
Make sure the GlobalValue is fully read.
Definition at line 386 of file Module.cpp.
References llvm::Error::success().
Referenced by llvm::GlobalValue::materialize().
| Error Module::materializeAll | ( | ) |
Make sure all GlobalValues in this Module are fully read and clear the Materializer.
Definition at line 393 of file Module.cpp.
References llvm::Error::success().
| Error Module::materializeMetadata | ( | ) |
Definition at line 400 of file Module.cpp.
References llvm::Error::success().
|
inline |
Definition at line 697 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
|
inline |
Definition at line 700 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
|
inline |
Definition at line 684 of file Module.h.
Referenced by named_metadata(), llvm::StripDebugInfo(), and llvm::stripNonLineTableDebugInfo().
|
inline |
|
inline |
Definition at line 689 of file Module.h.
Referenced by named_metadata(), llvm::StripDebugInfo(), and llvm::stripNonLineTableDebugInfo().
|
inline |
| void Module::print | ( | raw_ostream & | OS, |
| AssemblyAnnotationWriter * | AAW, | ||
| bool | ShouldPreserveUseListOrder = false, |
||
| bool | IsForDebug = false |
||
| ) | const |
Print the module to an output stream with an optional AssemblyAnnotationWriter.
If ShouldPreserveUseListOrder, then include uselistorder directives so that use-lists can be recreated when reading the assembly.
Definition at line 3376 of file AsmWriter.cpp.
Referenced by dump(), llvm::operator<<(), llvm::yaml::BlockScalarTraits< Module >::output(), and llvm::PrintModulePass::run().
|
inline |
Definition at line 576 of file Module.h.
Referenced by predictUseListOrder().
|
inline |
|
inline |
Definition at line 578 of file Module.h.
Referenced by predictUseListOrder().
|
inline |
| void Module::setDataLayout | ( | StringRef | Desc | ) |
Set the data layout.
Definition at line 355 of file Module.cpp.
References llvm::DataLayout::reset().
Referenced by LLVMTargetMachineEmit().
| void Module::setDataLayout | ( | const DataLayout & | Other | ) |
Definition at line 359 of file Module.cpp.
| 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 materializeAll 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 379 of file Module.cpp.
References assert().
|
inline |
|
inline |
Set the module-scope inline assembly blocks.
A trailing newline is added if the input doesn't have one.
Definition at line 273 of file Module.h.
References llvm::HexStyle::Asm.
| void Module::setOwnedMemoryBuffer | ( | std::unique_ptr< MemoryBuffer > | MB | ) |
Take ownership of the given memory buffer.
Definition at line 509 of file Module.cpp.
| void Module::setPICLevel | ( | PICLevel::Level | PL | ) |
Set the PIC level (small or large model)
Definition at line 483 of file Module.cpp.
References addModuleFlag(), and fuzzer::Max().
| void Module::setPIELevel | ( | PIELevel::Level | PL | ) |
Set the PIE level (small or large model)
Definition at line 497 of file Module.cpp.
References addModuleFlag(), and fuzzer::Max().
| void Module::setProfileSummary | ( | Metadata * | M | ) |
Attach profile summary metadata to this module.
Definition at line 501 of file Module.cpp.
References addModuleFlag(), and llvm::lltok::Error.
|
inline |
|
inline |
Set the target triple.
Definition at line 269 of file Module.h.
References T.
Referenced by llvm::LTOModule::setTargetTriple().
|
inline |
Definition at line 580 of file Module.h.
Referenced by llvm::PhysicalRegisterUsageInfo::doInitialization(), and findPartitions().
1.8.6