LLVM
8.0.1
|
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... | |
bool | getRtLibUseGOT () const |
Returns true if PLT should be avoided for RTLib calls. More... | |
void | setRtLibUseGOT () |
Set that PLT should be avoid for RTLib calls. 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... | |
unsigned | getInstructionCount () |
Returns the number of non-debug IR instructions in 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... | |
bool | shouldEmitInstrCountChangedRemark () |
Return true if size-info optimization remark is enabled, false otherwise. 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... | |
template<typename... ArgsTy> | |
Constant * | getOrInsertFunction (StringRef Name, AttributeList AttributeList, FunctionType *Invalid, ArgsTy... Args)=delete |
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, function_ref< GlobalVariable *()> CreateGlobalCallback) |
Look up the specified global in the module symbol table. More... | |
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 function for querying and setting code model | |
Optional< CodeModel::Model > | getCodeModel () const |
Returns the code model (tiny, small, kernel, medium or large model) More... | |
void | setCodeModel (CodeModel::Model CL) |
Set the code model (tiny, small, kernel, medium or large) 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... | |
Utility functions for querying and setting the build SDK version | |
void | setSDKVersion (const VersionTuple &V) |
Attach a build SDK version metadata to this module. More... | |
VersionTuple | getSDKVersion () const |
Get the build SDK version 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 74 of file Module.cpp.
Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 81 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 339 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(), getNamedGlobal(), llvm::CGProfilePass::run(), setCodeModel(), setPICLevel(), setPIELevel(), setProfileSummary(), setRtLibUseGOT(), setSDKVersion(), and llvm::UpgradeModuleFlags().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Constant * | Val | ||
) |
Definition at line 347 of file Module.cpp.
References addModuleFlag(), and llvm::ConstantAsMetadata::get().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 351 of file Module.cpp.
References addModuleFlag(), llvm::ConstantInt::get(), llvm::Type::getInt32Ty(), and Int32Ty.
void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 356 of file Module.cpp.
|
inline |
Definition at line 617 of file Module.h.
Referenced by aliases(), getMinVisibility(), LLVMGetFirstGlobalAlias(), LLVMGetLastGlobalAlias(), LLVMGetPreviousGlobalAlias(), and OptimizeGlobalAliases().
|
inline |
|
inline |
Definition at line 619 of file Module.h.
Referenced by aliases(), getMinVisibility(), LLVMGetFirstGlobalAlias(), LLVMGetLastGlobalAlias(), LLVMGetNextGlobalAlias(), and OptimizeGlobalAliases().
|
inline |
|
inline |
Definition at line 621 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doInitialization().
|
inline |
Definition at line 624 of file Module.h.
References alias_begin(), alias_end(), and llvm::make_range().
Referenced by dropAllReferences(), llvm::filterDeadComdatFunctions(), findPartitions(), llvm::StackSafetyInfo::FunctionInfo::FunctionInfo(), global_values(), llvm::nameUnamedGlobals(), orderModule(), rewriteComdat(), and llvm::TypeFinder::run().
|
inline |
Definition at line 627 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 295 of file Module.h.
References llvm::HexStyle::Asm, getIdentifiedStructTypes(), getMDKindID(), getMDKindNames(), getNamedValue(), getOperandBundleTags(), getOrInsertFunction(), getTypeByName(), and Name.
|
inline |
Definition at line 595 of file Module.h.
Referenced by llvm::PMDataManager::emitInstrCountChangedRemark(), functions(), getMinVisibility(), INITIALIZE_PASS_BEGIN(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetPreviousFunction(), OptimizeFunctions(), removeUseSoftFloat(), llvm::DeadArgumentEliminationPass::run(), stripDeadPrototypes(), useFuncSeen(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), and writeIdentificationBlock().
|
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 93 of file Module.cpp.
References llvm::sys::path::filename(), getModuleIdentifier(), and llvm::Pass::getPassName().
Referenced by getModuleInlineAsm().
|
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 778 of file Module.h.
References llvm::collectUsedGlobalVariables(), dropAllReferences(), dropTriviallyDeadConstantArrays(), dump(), getCodeModel(), getCodeViewFlag(), getDwarfVersion(), getNamedMetadata(), getNumberRegisterParameters(), getPICLevel(), getPIELevel(), getProfileSummary(), getRtLibUseGOT(), getSDKVersion(), llvm::make_range(), llvm::AArch64CC::PL, print(), setCodeModel(), setOwnedMemoryBuffer(), setPICLevel(), setPIELevel(), setProfileSummary(), setRtLibUseGOT(), and setSDKVersion().
Referenced by llvm::DwarfDebug::beginModule(), llvm::MachineModuleInfo::doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::BTFDebug::endModule(), and llvm::DebugInfoFinder::processModule().
|
inline |
Definition at line 765 of file Module.h.
References getNamedMetadata().
Referenced by llvm::DwarfDebug::beginModule().
|
inline |
Definition at line 770 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 441 of file Module.cpp.
References aliases(), llvm::Function::dropAllReferences(), F(), globals(), and ifuncs().
Referenced by debug_compile_units(), and ~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 160 of file LLVMContextImpl.cpp.
References Context, llvm::LLVMContextImpl::dropTriviallyDeadConstantArrays(), and llvm::LLVMContext::pImpl.
Referenced by debug_compile_units(), and llvm::IRMover::move().
LLVM_DUMP_METHOD void Module::dump | ( | ) | const |
Dump the module to stderr (for debugging).
Definition at line 4306 of file AsmWriter.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
Referenced by CheckMACMemory(), and debug_compile_units().
|
inline |
Definition at line 604 of file Module.h.
Referenced by llvm::symbolize::SymbolizableObjectFile::create(), INITIALIZE_PASS(), instrumentMaskedLoadOrStore(), and llvm::IRMutationStrategy::mutate().
|
inline |
Definition at line 597 of file Module.h.
Referenced by llvm::PMDataManager::emitInstrCountChangedRemark(), functions(), getMinVisibility(), INITIALIZE_PASS_BEGIN(), LLVMGetFirstFunction(), LLVMGetLastFunction(), LLVMGetNextFunction(), OptimizeFunctions(), removeUseSoftFloat(), llvm::DeadArgumentEliminationPass::run(), stripDeadPrototypes(), useFuncSeen(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), and writeIdentificationBlock().
|
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 274 of file Module.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::NamedMDNode::getName().
Referenced by getNamedGlobal().
|
inline |
Definition at line 606 of file Module.h.
References begin(), end(), and llvm::make_range().
Referenced by collectFunctionUsers(), llvm::filterDeadComdatFunctions(), findPartitions(), llvm::StackSafetyInfo::FunctionInfo::FunctionInfo(), global_objects(), global_values(), inferAllPrototypeAttributes(), llvm::DebugInfoFinder::processModule(), rewriteComdat(), llvm::ForceFunctionAttrsPass::run(), llvm::PrintModulePass::run(), llvm::ImportedFunctionsInliningStatistics::setModuleInfo(), and shouldKeepInEntry().
|
inline |
Definition at line 609 of file Module.h.
References begin(), end(), and llvm::make_range().
|
inline |
Get the Module's list of aliases (constant).
Definition at line 538 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent(), llvm::GlobalIndirectSymbol::GlobalIndirectSymbol(), maybeSetDSOLocal(), OptimizeGlobalAliases(), and llvm::GlobalAlias::removeFromParent().
|
inline |
Optional< CodeModel::Model > Module::getCodeModel | ( | ) | const |
Returns the code model (tiny, small, kernel, medium or large model)
Definition at line 518 of file Module.cpp.
References getModuleFlag(), and llvm::None.
Referenced by llvm::lto::Config::addSaveTemps(), and debug_compile_units().
unsigned Module::getCodeViewFlag | ( | ) | const |
Returns the CodeView Version by checking module flags.
Returns zero if not present in module.
Definition at line 470 of file Module.cpp.
References getModuleFlag().
Referenced by debug_compile_units(), llvm::AsmPrinter::doInitialization(), llvm::X86FrameLowering::emitPrologue(), and llvm::X86AsmPrinter::runOnMachineFunction().
|
inline |
Get the Module's symbol table for COMDATs (constant).
Definition at line 570 of file Module.h.
Referenced by createGlobalFwdRef(), getMinVisibility(), llvm::InternalizePass::internalizeModule(), and rewriteComdat().
|
inline |
|
inline |
Get the global data context.
Definition at line 244 of file Module.h.
References Context.
Referenced by llvm::LTOCodeGenerator::addModule(), llvm::IntrinsicLowering::AddPrototypes(), llvm::AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), annotateAllFunctions(), llvm::annotateValueSite(), appendToGlobalArray(), appendToUsedList(), assureFPCallStub(), llvm::CloneModule(), collectFunctionUsers(), createDevirtTriggerFunc(), createDummyFunction(), llvm::createEfficiencySanitizerPass(), createEmptyFunction(), createFPFnStub(), createFree(), CreateGCRelocates(), llvm::createHWAddressSanitizerPass(), createIRLevelProfileFlagVariable(), CreateLoadIns(), llvm::createPGOFuncNameVar(), createPrivateGlobalForSourceLoc(), llvm::createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::createSampleProfileLoaderPass(), llvm::createSanitizerCtorAndInitFunctions(), llvm::createThreadSanitizerLegacyPassPass(), CreateWrapper(), llvm::createX86RetpolineThunksPass(), llvm::declareSanitizerInitFunction(), doImportingForModule(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::emitMemCpyChk(), EmitMSInlineAsmStr(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), EnsureFPIntrinsicsExist(), llvm::CodeExtractor::findInputsOutputs(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::objcarc::ARCMDKindCache::get(), getChainID(), llvm::getCopyDeclaration(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::AMDGPUMangledLibFunc::getFunctionType(), llvm::TargetLoweringBase::getIRStackGuard(), getMinVisibility(), llvm::getOrCreateInitFunction(), llvm::getOrCreateSanitizerCtorAndInitFunctions(), llvm::AMDGPULibFunc::getOrInsertFunction(), getOrInsertGlobal(), getOrInsertValueProfilingCall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), getSignature(), llvm::InstrProfIncrementInst::getStep(), getSubprogram(), llvm::HexagonTargetLowering::getTgtMemIntrinsic(), llvm::FunctionImporter::importFunctions(), INITIALIZE_PASS(), insertLifetimeMarkersSurroundingCall(), InsertSafepointPoll(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), llvm::TargetLoweringBase::insertSSPDeclarations(), insertUseHolderAfter(), instrumentMaskedLoadOrStore(), instrumentOneFunc(), llvm::DenseMapInfo< VTableSlot >::isEqual(), llvm::log2(), MarkBlocksLiveIn(), llvm::IRMutator::mutateModule(), needsRuntimeRegistrationOfSectionRange(), PushArgMD(), llvm::CGProfilePass::run(), llvm::ScalarizerPass::run(), llvm::WholeProgramDevirtPass::run(), llvm::legacy::PassManagerImpl::run(), llvm::Float2IntPass::runImpl(), llvm::SanitizerStatReport::SanitizerStatReport(), llvm::setIrrLoopHeaderMetadata(), llvm::setProfMetadata(), shouldEmitInstrCountChangedRemark(), llvm::ModulePass::skipModule(), llvm::CallGraphSCCPass::skipSCC(), srcMgrDiagHandler(), llvm::stripNonLineTableDebugInfo(), StripSymbolNames(), SwitchToLookupTable(), switchToSelect(), llvm::lto::thinBackend(), llvm::UpgradeDebugInfo(), llvm::UpgradeModuleFlags(), llvm::UpgradeRetainReleaseMarker(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().
const DataLayout & Module::getDataLayout | ( | ) | const |
Get the data layout for the module's target platform.
Definition at line 371 of file Module.cpp.
Referenced by AddAlignmentAssumptions(), addBoundsChecking(), llvm::LoopAccessInfo::addRuntimeChecks(), llvm::IVUsers::AddUsersImpl(), allCallersPassInValidPointerForArgument(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::GlobalsAAResult::analyzeModule(), llvm::orc::LLJIT::applyDataLayout(), buildFrameType(), llvm::AAResults::callCapturesBefore(), llvm::objcarc::CanAlterRefCount(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), CanProveNotTakenFirstIteration(), llvm::objcarc::CanUse(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::CloneModule(), llvm::FunctionComparator::cmpOperations(), llvm::FunctionComparator::cmpTypes(), collectFunctionUsers(), combineInstructionsOverFunction(), computeAddrSpace(), llvm::ComputeLegalValueVTs(), computeRecurrenceType(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessorsImpl(), computeValueLLTs(), llvm::ConstantFoldCall(), llvm::SanitizerStatReport::create(), llvm::Function::Create(), llvm::createAMDGPUFunctionInliningPass(), llvm::createCodeGenPreparePass(), llvm::createConstantPropagationPass(), llvm::createEfficiencySanitizerPass(), createGlobalFwdRef(), llvm::createHWAddressSanitizerPass(), llvm::createLegacyPMBasicAAResult(), createMaskInstrs(), llvm::createMemDerefPrinter(), llvm::createPPCCTRLoopsVerify(), llvm::createThreadSanitizerLegacyPassPass(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::AMDGPUAAWrapperPass::doInitialization(), llvm::objcarc::ObjCARCAAWrapperPass::doInitialization(), doPromotion(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), eliminateTailRecursion(), llvm::AsmPrinter::EmitAlignment(), llvm::emitCalloc(), EmitCamlGlobal(), llvm::AsmPrinter::EmitDebugValue(), llvm::AsmPrinter::emitGlobalGOTEquivs(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel(), llvm::emitLinkerFlagsForGlobalCOFF(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailablePtrLoadStore(), llvm::CodeExtractor::findInputsOutputs(), findLoadCallsAtConstantOffset(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::StackSafetyInfo::FunctionInfo::FunctionInfo(), llvm::MCJIT::generateCodeForModule(), llvm::MemoryLocation::get(), getAlignment(), getAllocaSizeInBytes(), getAtomicOpAlign(), getAtomicOpSize(), llvm::getBestSimplifyQuery(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRange(), llvm::LazyValueInfo::getConstantRangeOnEdge(), llvm::LLParser::getContext(), llvm::AsmPrinter::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::ScalarEvolution::getDataLayout(), getDataLayoutStr(), llvm::DemandedBits::getDemandedBits(), getEdgeValueLocal(), llvm::AMDGPUSubtarget::getExplicitKernArgSize(), getFirstNonAllocaInTheEntryBlock(), llvm::getGEPInductionOperand(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::getInlineCost(), getIntrinsicForMaskedAtomicRMWBinOp32(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::MemoryDependenceResults::getLoadLoadClobberFullWidthSize(), llvm::ExecutionEngine::getMangledName(), getMinVisibility(), llvm::GlobalsAAResult::getModRefBehavior(), llvm::Mangler::getNameWithPrefix(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), getOrInsertGlobal(), GetPointerOperand(), llvm::LazyValueInfo::getPredicateAt(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::NVPTXTargetLowering::getPrototype(), llvm::getPtrStride(), llvm::SCEVExpander::getRelatedExistingExpansion(), GetRMWLibcall(), getScalarIntrinsicDeclaration(), llvm::TargetLoweringObjectFile::getSectionForJumpTable(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::MipsTargetMachine::getTargetTransformInfo(), llvm::TargetMachine::getTargetTransformInfo(), llvm::HexagonTargetLowering::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), getTypePartition(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), GlobalWasGeneratedByCompiler(), llvm::MipsCallLowering::MipsHandler::handle(), llvm::CallLowering::handleAssignments(), HandleByValArgument(), HandleByValArgumentInit(), handleEndBlock(), handleFree(), hasProfileData(), hasUndefContents(), llvm::hoistRegion(), llvm::DataLayout::init(), INITIALIZE_PASS(), llvm::InlineFunction(), insertIfNamed(), instrumentMaskedLoadOrStore(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), llvm::isAllocaPromotable(), isAlwaysLive(), isAtomic(), llvm::DenseMapInfo< VTableSlot >::isEqual(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), isIgnorableInst(), llvm::InductionDescriptor::isInductionPHI(), llvm::isLegalToPromote(), isLoadConditional(), isLoadInvariantInLoop(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), IsOperandAMemoryOperand(), isPointerValueDeadOnEntryToFunction(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), llvm::isSafeToSpeculativelyExecute(), IsSmallObject(), llvm::LoopVectorizationLegality::isUniform(), isZero(), llvm::AArch64TargetLowering::isZExtFree(), llvm::LibCallSimplifier::LibCallSimplifier(), llvm::X86CallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::AMDGPUCallLowering::lowerReturn(), llvm::AArch64CallLowering::lowerReturn(), MarkBlocksLiveIn(), llvm::gvn::AvailableValue::MaterializeAdjustedValue(), maybePrintCallAddrSpace(), maybePrintComdat(), mayLoopAccessLocation(), mayUsePostIncMode(), memOpsHaveSameBasePtr(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), mergeInlinedArrayAllocas(), moveUp(), operator<<(), OptimizeGlobalVars(), patchAndReplaceAllUsesWith(), performGlobalAddressCombine(), llvm::MemoryDepChecker::Dependence::print(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processInternalGlobal(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), RedzoneSizeForScale(), relocationViaAlloca(), llvm::replaceAllDbgUsesWith(), replaceAndRecursivelySimplifyImpl(), replaceFrameSize(), ReplaceUsesOfWith(), reportMayClobberedLoad(), llvm::returnTypeIsEligibleForTailCall(), llvm::LoopRotatePass::run(), llvm::NewGVNPass::run(), llvm::GlobalOptPass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::IPSCCPPass::run(), llvm::EarlyCSEPass::run(), llvm::InstSimplifyPass::run(), llvm::SCCPPass::run(), llvm::AAEvaluator::run(), llvm::AMDGPUAA::run(), llvm::objcarc::ObjCARCAA::run(), llvm::LazyValueAnalysis::run(), llvm::WholeProgramDevirtPass::run(), llvm::BasicAA::run(), llvm::TargetIRAnalysis::run(), llvm::SLPVectorizerPass::runImpl(), llvm::NaryReassociatePass::runImpl(), llvm::ConstantHoistingPass::runImpl(), runImpl(), llvm::LazyValueInfoWrapperPass::runOnFunction(), llvm::BasicAAWrapperPass::runOnFunction(), llvm::IRTranslator::runOnMachineFunction(), selectELFSectionForGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), llvm::HexagonTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::HexagonTargetObjectFile::shouldPutJumpTableInFunctionSection(), llvm::simplifyCFG(), llvm::SimplifyInstructionsInBlock(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), AllocaSlices::SliceBuilder::SliceBuilder(), splitGlobal(), splitMergedValStore(), StackMallocSizeClass(), llvm::LazyValueInfo::threadEdge(), llvm::JumpThreadingPass::ThreadGuard(), tryToVectorizeHorReductionOrInstOperands(), TypeSizeToSizeIndex(), llvm::UnrollRuntimeLoopRemainder(), llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::updatePointer(), valueCoversEntireFragment(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), llvm::LoopVersioning::versionLoop(), visitIVCast(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Get the data layout string for the module's target platform.
This is equivalent to getDataLayout()->getStringRepresentation().
Definition at line 231 of file Module.h.
References getDataLayout(), and llvm::DataLayout::getStringRepresentation().
Referenced by getStringEncoding().
unsigned Module::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version by checking module flags.
Definition at line 463 of file Module.cpp.
References getModuleFlag().
Referenced by debug_compile_units(), 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 176 of file Module.cpp.
References getNamedValue().
Referenced by assureFPCallStub(), containsProfilingIntrinsics(), createDevirtTriggerFunc(), eraseDeadBBsAndChildren(), explicifyGuards(), FindCXAAtExit(), llvm::sampleprof::FunctionSamples::findInlinedFunctions(), llvm::MCJIT::findModuleForSymbol(), llvm::getOrCreateInitFunction(), llvm::getOrCreateSanitizerCtorAndInitFunctions(), getOrInsertFunction(), getSignature(), llvm::AArch64TargetLowering::getSSPStackGuardCheck(), llvm::X86TargetLowering::getSSPStackGuardCheck(), llvm::SelectionDAG::getSymbolFunctionGlobalAddress(), hasReturnsTwiceAttr(), llvm::inferLibFuncAttributes(), InsertSafepointPoll(), instrumentMaskedLoadOrStore(), isDirectCall(), isObjectDereferencedInBlock(), lowerGuardIntrinsic(), needsRuntimeRegistrationOfSectionRange(), llvm::MIRParserImpl::parseMachineFunction(), prepareForSplit(), replaceDevirtTrigger(), rewriteComdat(), llvm::JumpThreadingPass::runImpl(), llvm::ScalarEvolution::ScalarEvolution(), shouldKeepInEntry(), splitGlobals(), llvm::stripNonLineTableDebugInfo(), StripSymbolNames(), unswitchBestCondition(), and llvm::InnerLoopVectorizer::widenInstruction().
|
inline |
Get the Module's list of functions (constant).
Definition at line 530 of file Module.h.
Referenced by computeAddrSpace(), llvm::AsmPrinter::doInitialization(), doPromotion(), getRetComponentType(), PushArgMD(), and llvm::CallGraph::removeFunctionFromModule().
|
inline |
|
inline |
Get the Module's list of global variables (constant).
Definition at line 521 of file Module.h.
Referenced by llvm::NVPTXAsmPrinter::doFinalization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalVariable::GlobalVariable(), maybeSetDSOLocal(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalVariable::removeFromParent(), removeGlobalCtors(), llvm::WholeProgramDevirtPass::run(), 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 387 of file Module.h.
Referenced by appendToUsedList(), llvm::collectUsedGlobalVariables(), findGlobalCtors(), llvm::MCJIT::findModuleForSymbol(), getGlobalVariable(), getNamedGlobal(), llvm::AArch64TargetLowering::getSDagStackGuard(), llvm::X86TargetLowering::getSDagStackGuard(), INITIALIZE_PASS(), instrumentMaskedLoadOrStore(), mergeConstants(), needsRuntimeRegistrationOfSectionRange(), rewriteComdat(), 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 191 of file Module.cpp.
References getNamedValue().
|
inline |
Definition at line 393 of file Module.h.
References getGlobalVariable().
std::vector< StructType * > Module::getIdentifiedStructTypes | ( | ) | const |
Definition at line 420 of file Module.cpp.
References llvm::TypeFinder::begin(), llvm::TypeFinder::end(), llvm::MipsISD::Ret, and llvm::TypeFinder::run().
Referenced by appendModuleInlineAsm(), and llvm::createEfficiencySanitizerPass().
|
inline |
Get the Module's list of ifuncs (constant).
Definition at line 547 of file Module.h.
Referenced by llvm::GlobalIFunc::eraseFromParent(), maybeSetDSOLocal(), llvm::GlobalIFunc::removeFromParent(), and llvm::GlobalAlias::setAliasee().
|
inline |
unsigned Module::getInstructionCount | ( | ) |
Returns the number of non-debug IR instructions in the module.
This is equivalent to the sum of the IR instruction counts of each function contained in the module.
Definition at line 477 of file Module.cpp.
References F().
Referenced by llvm::FPPassManager::doFinalization(), and getModuleIdentifier().
|
inline |
Retrieves the GVMaterializer, if any, for this Module.
Definition at line 504 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 120 of file Module.cpp.
References llvm::LLVMContext::getMDKindID().
Referenced by appendModuleInlineAsm(), and parseOptionalLinkageAux().
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 127 of file Module.cpp.
References llvm::LLVMContext::getMDKindNames().
Referenced by appendModuleInlineAsm().
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 312 of file Module.cpp.
References getModuleFlagsMetadata().
Referenced by llvm::buildModuleSummaryIndex(), llvm::CodeViewDebug::CodeViewDebug(), llvm::createX86IndirectBranchTrackingPass(), llvm::AsmPrinter::doInitialization(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::X86TargetLowering::expandIndirectJTBranch(), getCodeModel(), getCodeViewFlag(), llvm::getDebugMetadataVersionFromModule(), getDwarfVersion(), getMOVL(), getNamedGlobal(), getNumberRegisterParameters(), getPICLevel(), getPIELevel(), getProfileSummary(), getRetpolineSymbol(), getRtLibUseGOT(), getSDKVersion(), 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 292 of file Module.cpp.
References getModuleFlagsMetadata(), isValidModFlagBehavior(), llvm::NamedMDNode::operands(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::orc::cloneModuleFlagsMetadata(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), 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 325 of file Module.cpp.
References getNamedMetadata().
Referenced by getModuleFlag(), getModuleFlagsMetadata(), getNamedGlobal(), and isValidModFlagBehavior().
|
inline |
Get the module identifier which is, essentially, the name of the module.
Definition at line 210 of file Module.h.
References getInstructionCount().
Referenced by llvm::CloneModule(), llvm::createEfficiencySanitizerPass(), createRNG(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::FPPassManager::doFinalization(), llvm::FunctionImportGlobalProcessing::doImportAsDefinition(), doImportingForModule(), EmitCamlGlobal(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), getDebugLocString(), GetGlobalTypeString(), llvm::orc::IRMaterializationUnit::getName(), llvm::ModuleSummaryIndex::hasExportedFunctions(), llvm::FunctionImporter::importFunctions(), instrumentMaskedLoadOrStore(), llvm::ThinLTOCodeGenerator::internalize(), llvm::LazyCallGraph::LazyCallGraph(), normalizePBQPSpillWeight(), llvm::DiagnosticPrinterRawOStream::operator<<(), llvm::ThinLTOCodeGenerator::promote(), rewriteComdat(), llvm::LazyCallGraphPrinterPass::run(), llvm::LazyCallGraphDOTPrinterPass::run(), and llvm::VerifierSupport::VerifierSupport().
|
inline |
Get any module-scope inline assembly blocks.
Definition at line 248 of file Module.h.
References createRNG(), and P.
Referenced by llvm::buildModuleSummaryIndex(), llvm::CloneModule(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::AsmPrinter::doInitialization(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), getStringEncoding(), INITIALIZE_PASS(), initializeRecordStreamer(), and llvm::BitcodeWriter::writeSymtab().
|
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 227 of file Module.h.
Referenced by llvm::orc::cloneToNewContext(), llvm::createHWAddressSanitizerPass(), dumpIR(), getDescription(), llvm::StackSafetyGlobalPrinterPass::run(), llvm::ProfileSummaryPrinterPass::run(), llvm::ImportedFunctionsInliningStatistics::setModuleInfo(), and shouldApply().
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 241 of file Module.cpp.
References getNamedValue().
Referenced by getNamedGlobal(), and rewriteComdat().
|
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 402 of file Module.h.
References getGlobalVariable().
Referenced by appendToGlobalArray(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::orc::getConstructors(), llvm::orc::getDestructors(), getGlobalVariableI32(), getNamedGlobal(), INITIALIZE_PASS(), llvm::isIRPGOFlagSet(), llvm::TargetLowering::LowerToTLSEmulatedModel(), llvm::InstrProfiling::run(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().
|
inline |
Definition at line 405 of file Module.h.
References addModuleFlag(), llvm::Module::ModuleFlagEntry::Behavior, eraseNamedMetadata(), getModuleFlag(), getModuleFlagsMetadata(), getNamedAlias(), getNamedGlobal(), getNamedIFunc(), getNamedMetadata(), getOrInsertComdat(), getOrInsertGlobal(), getOrInsertModuleFlagsMetadata(), getOrInsertNamedMetadata(), llvm::Module::ModuleFlagEntry::Key, and llvm::Module::ModuleFlagEntry::Val.
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 245 of file Module.cpp.
References getNamedValue().
Referenced by getNamedGlobal().
|
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 252 of file Module.cpp.
References lookup(), and llvm::Twine::toStringRef().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::cacheAnnotationFromMD(), llvm::CodeViewDebug::CodeViewDebug(), llvm::createObjCARCContractPass(), debug_compile_units(), debug_compile_units_begin(), debug_compile_units_end(), llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), getModuleFlagsMetadata(), getNamedGlobal(), getStringIdTypeIdx(), getSubprogram(), getSymbolName(), parseVersion(), PushArgMD(), shouldKeepInEntry(), and llvm::UpgradeRetainReleaseMarker().
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 114 of file Module.cpp.
References getValueSymbolTable(), and llvm::ValueSymbolTable::lookup().
Referenced by appendModuleInlineAsm(), llvm::buildModuleSummaryIndex(), llvm::coro::declaresIntrinsics(), llvm::RecordStreamer::flushSymverDirectives(), forceRenaming(), FunctionNumber(), getComdatGVForCOFF(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), getFunction(), getGlobalVariable(), getMinVisibility(), getNamedAlias(), getNamedIFunc(), getOrInsertFunction(), getOrInsertGlobal(), llvm::TargetLoweringBase::getSDagStackGuard(), INITIALIZE_PASS(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::X86InstrInfo::insertOutlinedCall(), llvm::TargetLoweringBase::insertSSPDeclarations(), maybeSetDSOLocal(), llvm::objcarc::ModuleHasARC(), and llvm::LinkDiagnosticInfo::print().
unsigned Module::getNumberRegisterParameters | ( | ) | const |
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition at line 455 of file Module.cpp.
References getModuleFlag().
Referenced by debug_compile_units().
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 131 of file Module.cpp.
References llvm::LLVMContext::getOperandBundleTags().
Referenced by appendModuleInlineAsm().
Return the Comdat in the module with the specified name.
It is created if it didn't already exist.
Definition at line 484 of file Module.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::insert().
Referenced by canRenameComdat(), copyComdat(), createGlobalFwdRef(), llvm::createHWAddressSanitizerPass(), createIRLevelProfileFlagVariable(), llvm::createX86RetpolineThunksPass(), llvm::FunctionImportGlobalProcessing::doImportAsDefinition(), getNamedGlobal(), getOrCreateProfileComdat(), getOrInsertGlobal(), instrumentMaskedLoadOrStore(), needsRuntimeRegistrationOfSectionRange(), rewriteComdat(), and llvm::WholeProgramDevirtPass::run().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T, | ||
AttributeList | AttributeList | ||
) |
Look up the specified function in the module symbol table.
Four possibilities:
Definition at line 144 of file Module.cpp.
References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F(), llvm::PointerType::get(), llvm::GlobalValue::getAddressSpace(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::DataLayout::getProgramAddressSpace(), llvm::GlobalValue::getType(), llvm::Function::isIntrinsic(), Name, llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back(), and llvm::Function::setAttributes().
Referenced by appendModuleInlineAsm(), llvm::SanitizerStatReport::create(), createDummyFunction(), llvm::createEfficiencySanitizerPass(), createFree(), llvm::createHWAddressSanitizerPass(), createMalloc(), createPrivateNonConstGlobalForString(), CreatePrologue(), llvm::createSanitizerCtorAndInitFunctions(), llvm::createThreadSanitizerLegacyPassPass(), llvm::declareSanitizerInitFunction(), llvm::emitBinaryFloatFnCall(), llvm::emitCalloc(), llvm::emitFGetCUnlocked(), llvm::emitFGetSUnlocked(), llvm::emitFPutC(), llvm::emitFPutCUnlocked(), llvm::emitFPutS(), llvm::emitFPutSUnlocked(), llvm::emitFReadUnlocked(), llvm::emitFWrite(), llvm::emitFWriteUnlocked(), llvm::emitMalloc(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::emitPutChar(), llvm::emitPutS(), llvm::emitStrChr(), llvm::emitStrCpy(), llvm::emitStrLen(), llvm::emitStrNCmp(), llvm::emitStrNCpy(), emitUnaryFloatFnCallHelper(), EnsureFunctionExists(), eraseDeadBBsAndChildren(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::getCopyDeclaration(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), getOrInsertFunction(), llvm::AMDGPULibFunc::getOrInsertFunction(), getOrInsertGlobal(), getOrInsertValueProfilingCall(), GetRMWLibcall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), getSqrtCall(), INITIALIZE_PASS(), insertCall(), insertSinCosCall(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), insertUseHolderAfter(), instrumentMaskedLoadOrStore(), isReportingError(), lowerObjCCall(), makeStatepointExplicitImpl(), MarkBlocksLiveIn(), mayLoopAccessLocation(), PushArgMD(), ReplaceCallWith(), and shouldKeepInEntry().
Constant * Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T | ||
) |
Definition at line 168 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 354 of file Module.h.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::FunctionType::get(), and getOrInsertFunction().
|
inline |
Same as above, but without the attributes.
Definition at line 366 of file Module.h.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, getFunction(), getOrInsertFunction(), and llvm::AArch64CC::Invalid.
|
delete |
Constant * Module::getOrInsertGlobal | ( | StringRef | Name, |
Type * | Ty, | ||
function_ref< GlobalVariable *()> | CreateGlobalCallback | ||
) |
Look up the specified global in the module symbol table.
getOrInsertGlobal - Look up the specified global in the module symbol table.
If it does not exist, invoke a callback to create a declaration of the global and return it. The global is constantexpr casted to the expected type if necessary.
Definition at line 206 of file Module.cpp.
References assert(), llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::Type::getPointerAddressSpace(), and llvm::GlobalValue::getType().
Referenced by llvm::createHWAddressSanitizerPass(), eraseDeadBBsAndChildren(), llvm::TargetLoweringBase::getIRStackGuard(), getNamedGlobal(), getOrInsertGlobal(), getOrInsertGlobal(), INITIALIZE_PASS(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), instrumentMaskedLoadOrStore(), llvm::WholeProgramDevirtPass::run(), and StackMallocSizeClass().
Look up the specified global in the module symbol table.
If required, this overload constructs the global variable using its constructor's defaults.
Definition at line 227 of file Module.cpp.
References llvm::GlobalValue::ExternalLinkage, and getOrInsertGlobal().
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 332 of file Module.cpp.
References getOrInsertNamedMetadata().
Referenced by addModuleFlag(), and getNamedGlobal().
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 261 of file Module.cpp.
References Name, and llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back().
Referenced by llvm::DIBuilder::createCompileUnit(), getNamedGlobal(), getOrInsertModuleFlagsMetadata(), and StripSymbolNames().
PICLevel::Level Module::getPICLevel | ( | ) | const |
Returns the PIC level (small or large model)
Definition at line 490 of file Module.cpp.
References getModuleFlag(), and llvm::PICLevel::NotPIC.
Referenced by llvm::lto::Config::addSaveTemps(), debug_compile_units(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::SparcTargetLowering::makeAddress(), and mayUseP9Setb().
PIELevel::Level Module::getPIELevel | ( | ) | const |
Returns the PIE level (small or large model)
Definition at line 504 of file Module.cpp.
References llvm::PIELevel::Default, and getModuleFlag().
Referenced by debug_compile_units(), llvm::TargetMachine::getTLSModel(), and llvm::TargetMachine::shouldAssumeDSOLocal().
Metadata * Module::getProfileSummary | ( | ) |
Returns profile summary metadata.
Definition at line 540 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::createSampleProfileLoaderPass(), debug_compile_units(), and getEntryForPercentile().
bool Module::getRtLibUseGOT | ( | ) | const |
Returns true if PLT should be avoided for RTLib calls.
Definition at line 548 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::X86Subtarget::classifyGlobalFunctionReference(), debug_compile_units(), llvm::inferLibFuncAttributes(), and llvm::TargetMachine::shouldAssumeDSOLocal().
VersionTuple Module::getSDKVersion | ( | ) | const |
Get the build SDK version metadata.
An empty version is returned if no such metadata is attached.
Definition at line 571 of file Module.cpp.
References getModuleFlag(), and llvm::None.
Referenced by debug_compile_units(), and llvm::AsmPrinter::doInitialization().
|
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 221 of file Module.h.
Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), llvm::getPGOFuncName(), llvm::thinLTOInternalizeModule(), and llvm::WriteIndexToFile().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Get the target triple which is a string describing the target host.
Definition at line 240 of file Module.h.
Referenced by llvm::ModuleSymbolTable::addModule(), llvm::lto::Config::addSaveTemps(), llvm::GlobalValue::canIncreaseAlignment(), llvm::CloneModule(), llvm::CodeViewDebug::CodeViewDebug(), copyFeaturesToFunction(), llvm::createEfficiencySanitizerPass(), llvm::createHWAddressSanitizerPass(), createIRLevelProfileFlagVariable(), CreateVarArgHelper(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::AMDGPUAAWrapperPass::doInitialization(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), getDefaultPersonalityFn(), getOrCreateProfileComdat(), getOrInsertGlobal(), getStringEncoding(), llvm::LTOModule::getTargetTriple(), INITIALIZE_PASS(), insertSinCosCall(), instrumentMaskedLoadOrStore(), llvm::ThinLTOCodeGenerator::internalize(), isCallingConvCCompatible(), mayLoopAccessLocation(), llvm::needsComdatForCounter(), needsRuntimeRegistrationOfSectionRange(), llvm::ThinLTOCodeGenerator::optimize(), llvm::ThinLTOCodeGenerator::promote(), llvm::InstrProfiling::run(), llvm::AMDGPUAA::run(), llvm::WholeProgramDevirtPass::run(), llvm::TargetLibraryAnalysis::run(), selectJumpTableArmEncoding(), shouldInstrumentReadWriteFromAddress(), llvm::WriteBitcodeToFile(), and llvm::ValueSymbolTable::~ValueSymbolTable().
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 522 of file Type.cpp.
References llvm::Type::getContext(), llvm::LLVMContextImpl::NamedStructTypes, and llvm::LLVMContext::pImpl.
Referenced by appendModuleInlineAsm().
|
inline |
Get the symbol table of global variable and function identifiers.
Definition at line 565 of file Module.h.
Referenced by createGlobalFwdRef(), llvm::createSampleProfileLoaderPass(), llvm::AMDGPULibFunc::getFunction(), getNamedValue(), and llvm::AMDGPULibFunc::getOrInsertFunction().
|
inline |
|
inline |
Definition at line 578 of file Module.h.
Referenced by llvm::CloneModule(), getMinVisibility(), globals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetPreviousGlobal(), makeVisible(), mergeConstants(), OptimizeGlobalVars(), splitGlobals(), stripDeadPrototypes(), and StripSymbolNames().
|
inline |
|
inline |
Definition at line 580 of file Module.h.
Referenced by llvm::CloneModule(), getMinVisibility(), globals(), LLVMGetFirstGlobal(), LLVMGetLastGlobal(), LLVMGetNextGlobal(), makeVisible(), maybeSetDSOLocal(), mergeConstants(), OptimizeGlobalVars(), splitGlobals(), stripDeadPrototypes(), and StripSymbolNames().
|
inline |
|
inline |
Definition at line 666 of file Module.h.
References global_objects().
|
inline |
Definition at line 671 of file Module.h.
References global_objects().
|
inline |
Definition at line 669 of file Module.h.
References global_objects().
|
inline |
Definition at line 674 of file Module.h.
References global_objects().
|
inline |
Definition at line 659 of file Module.h.
References functions(), and globals().
Referenced by llvm::ExecutionEngine::clearGlobalMappingsFromModule(), global_object_begin(), global_object_end(), llvm::nameUnamedGlobals(), and llvm::WholeProgramDevirtPass::run().
|
inline |
Definition at line 662 of file Module.h.
References functions(), and globals().
|
inline |
Definition at line 693 of file Module.h.
References global_values().
|
inline |
Definition at line 696 of file Module.h.
References global_values().
|
inline |
Definition at line 694 of file Module.h.
References global_values().
|
inline |
Definition at line 699 of file Module.h.
References global_values().
|
inline |
Definition at line 685 of file Module.h.
References aliases(), functions(), globals(), and ifuncs().
Referenced by llvm::ModuleSymbolTable::addModule(), dropDeadSymbols(), llvm::RecordStreamer::flushSymverDirectives(), global_value_begin(), global_value_end(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), and llvm::orc::SymbolLinkagePromoter::operator()().
|
inline |
|
inline |
Definition at line 584 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
Referenced by llvm::DwarfDebug::beginModule(), llvm::AsmPrinter::computeGlobalGOTEquivs(), llvm::AsmPrinter::doFinalization(), llvm::FunctionImportGlobalProcessing::doImportAsDefinition(), llvm::NVPTXAsmPrinter::doInitialization(), dropAllReferences(), eliminateAvailableExternally(), llvm::ExecutionEngine::emitGlobals(), llvm::filterDeadComdatFunctions(), findPartitions(), getStringEncoding(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), getSymbolName(), global_objects(), global_values(), INITIALIZE_PASS(), instrumentMaskedLoadOrStore(), internalizeImmutableGVs(), isZeroLengthArray(), optimizeGlobalsInModule(), orderModule(), predictUseListOrder(), rewriteComdat(), llvm::TypeFinder::run(), llvm::WholeProgramDevirtPass::run(), llvm::stripNonLineTableDebugInfo(), StripSymbolNames(), llvm::UpgradeSectionAttributes(), llvm::ValueEnumerator::ValueEnumerator(), and llvm::WriteIndexToFile().
|
inline |
Definition at line 587 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 642 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
Referenced by dropAllReferences(), global_values(), and orderModule().
|
inline |
Definition at line 645 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
|
inline |
Definition at line 505 of file Module.h.
References getMaterializer(), materialize(), materializeAll(), and materializeMetadata().
Referenced by llvm::Value::assertModuleIsMaterializedImpl(), llvm::BitcodeWriter::writeModule(), and llvm::BitcodeWriter::writeThinLinkBitcode().
|
static |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition at line 279 of file Module.cpp.
References getModuleFlagsMetadata(), ModFlagBehaviorFirstVal, and ModFlagBehaviorLastVal.
Referenced by getModuleFlagsMetadata().
Error Module::materialize | ( | GlobalValue * | GV | ) |
Make sure the GlobalValue is fully read.
Definition at line 396 of file Module.cpp.
References llvm::Error::success().
Referenced by isMaterialized(), and llvm::GlobalValue::materialize().
Error Module::materializeAll | ( | ) |
Make sure all GlobalValues in this Module are fully read and clear the Materializer.
Definition at line 403 of file Module.cpp.
References llvm::Error::success().
Referenced by llvm::MCJIT::emitObject(), and isMaterialized().
Error Module::materializeMetadata | ( | ) |
Definition at line 410 of file Module.cpp.
References llvm::Error::success().
Referenced by isMaterialized().
|
inline |
Definition at line 720 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
Referenced by llvm::ValueEnumerator::print(), and rotateSign().
|
inline |
Definition at line 723 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
|
inline |
Definition at line 707 of file Module.h.
Referenced by LLVMGetFirstNamedMetadata(), LLVMGetLastNamedMetadata(), LLVMGetPreviousNamedMetadata(), named_metadata(), llvm::StripDebugInfo(), and llvm::stripNonLineTableDebugInfo().
|
inline |
|
inline |
Definition at line 718 of file Module.h.
Referenced by rotateSign().
|
inline |
Definition at line 712 of file Module.h.
Referenced by LLVMGetFirstNamedMetadata(), LLVMGetLastNamedMetadata(), LLVMGetNextNamedMetadata(), 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 4065 of file AsmWriter.cpp.
References llvm::RISCVFenceField::W.
Referenced by debug_compile_units(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::operator<<(), llvm::yaml::BlockScalarTraits< Module >::output(), and llvm::PrintModulePass::run().
|
inline |
Definition at line 599 of file Module.h.
Referenced by predictUseListOrder().
|
inline |
|
inline |
Definition at line 601 of file Module.h.
Referenced by predictUseListOrder().
|
inline |
void Module::setCodeModel | ( | CodeModel::Model | CL | ) |
Set the code model (tiny, small, kernel, medium or large)
Definition at line 528 of file Module.cpp.
References addModuleFlag(), and llvm::Error.
Referenced by debug_compile_units().
void Module::setDataLayout | ( | StringRef | Desc | ) |
Set the data layout.
Definition at line 365 of file Module.cpp.
References llvm::DataLayout::reset().
Referenced by llvm::orc::LLJIT::applyDataLayout(), LLVMTargetMachineEmit(), and setSourceFileName().
void Module::setDataLayout | ( | const DataLayout & | Other | ) |
Definition at line 369 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 389 of file Module.cpp.
References assert().
Referenced by llvm::getBitcodeFileContents().
|
inline |
|
inline |
Set the module-scope inline assembly blocks.
A trailing newline is added if the input doesn't have one.
Definition at line 287 of file Module.h.
References llvm::HexStyle::Asm.
Referenced by INITIALIZE_PASS(), and makeVisible().
void Module::setOwnedMemoryBuffer | ( | std::unique_ptr< MemoryBuffer > | MB | ) |
Take ownership of the given memory buffer.
Definition at line 544 of file Module.cpp.
Referenced by debug_compile_units().
void Module::setPICLevel | ( | PICLevel::Level | PL | ) |
Set the PIC level (small or large model)
Definition at line 500 of file Module.cpp.
References addModuleFlag().
Referenced by debug_compile_units().
void Module::setPIELevel | ( | PIELevel::Level | PL | ) |
Set the PIE level (small or large model)
Definition at line 514 of file Module.cpp.
References addModuleFlag().
Referenced by debug_compile_units().
void Module::setProfileSummary | ( | Metadata * | M | ) |
Attach profile summary metadata to this module.
Definition at line 536 of file Module.cpp.
References addModuleFlag(), and llvm::Error.
Referenced by llvm::createSampleProfileLoaderPass(), and debug_compile_units().
void Module::setRtLibUseGOT | ( | ) |
Set that PLT should be avoid for RTLib calls.
Definition at line 553 of file Module.cpp.
References addModuleFlag().
Referenced by debug_compile_units().
void Module::setSDKVersion | ( | const VersionTuple & | V | ) |
Attach a build SDK version metadata to this module.
Definition at line 557 of file Module.cpp.
References addModuleFlag(), llvm::ConstantDataArray::get(), llvm::VersionTuple::getMajor(), llvm::VersionTuple::getMinor(), llvm::VersionTuple::getSubminor(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Warning.
Referenced by debug_compile_units().
|
inline |
Set the module's original source file name.
Definition at line 276 of file Module.h.
References Name, Other, and setDataLayout().
|
inline |
Set the target triple.
Definition at line 283 of file Module.h.
References T.
Referenced by llvm::LTOModule::setTargetTriple().
|
inline |
Return true if size-info optimization remark is enabled, false otherwise.
Definition at line 263 of file Module.h.
References getContext(), llvm::LLVMContext::getDiagHandlerPtr(), and llvm::DiagnosticHandler::isAnalysisRemarkEnabled().
Referenced by llvm::FPPassManager::doFinalization(), llvm::AnalysisResolver::findImplPass(), INITIALIZE_PASS(), llvm::LPPassManager::runOnFunction(), and llvm::FPPassManager::runOnFunction().
|
inline |
Definition at line 603 of file Module.h.
Referenced by llvm::PhysicalRegisterUsageInfo::doInitialization(), findPartitions(), hasProfileData(), and llvm::ThinLTOCodeGenerator::run().