LLVM
13.0.0git
|
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 | getSemanticInterposition () const |
Returns whether semantic interposition is to be respected. More... | |
void | setSemanticInterposition (bool) |
Set whether semantic interposition is to be respected. 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... | |
void | setPartialSampleProfileRatio (const ModuleSummaryIndex &Index) |
Set the partial sample profile ratio in the profile summary module flag, if applicable. 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 StringRef Name) 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... | |
std::vector< StructType * > | getIdentifiedStructTypes () const |
Function Accessors | |
FunctionCallee | getOrInsertFunction (StringRef Name, FunctionType *T, AttributeList AttributeList) |
Look up the specified function in the module symbol table. More... | |
FunctionCallee | getOrInsertFunction (StringRef Name, FunctionType *T) |
template<typename... ArgsTy> | |
FunctionCallee | getOrInsertFunction (StringRef Name, AttributeList AttributeList, Type *RetTy, ArgsTy... Args) |
Look up the specified function in the module symbol table. More... | |
template<typename... ArgsTy> | |
FunctionCallee | getOrInsertFunction (StringRef Name, Type *RetTy, ArgsTy... Args) |
Same as above, but without the attributes. More... | |
template<typename... ArgsTy> | |
FunctionCallee | 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) |
void | setModuleFlag (ModFlagBehavior Behavior, StringRef Key, Metadata *Val) |
Like addModuleFlag but replaces the old module flag if it already exists. More... | |
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 |
size_t | global_size () 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... | |
bool | isDwarf64 () const |
Returns the DWARF format 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, ProfileSummary::Kind Kind) |
Attach profile summary metadata to this module. More... | |
Metadata * | getProfileSummary (bool IsCS) const |
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... | |
Types And Enumerations | |
enum | ModFlagBehavior { Error = 1, Warning = 2, Require = 3, Override = 4, Append = 5, AppendUnique = 6, Max = 7, ModFlagBehaviorFirstVal = Error, ModFlagBehaviorLastVal = Max } |
This enumeration defines the supported behaviors of module flags. More... | |
using | GlobalListType = SymbolTableList< GlobalVariable > |
The type for the list of global variables. More... | |
using | FunctionListType = SymbolTableList< Function > |
The type for the list of functions. More... | |
using | AliasListType = SymbolTableList< GlobalAlias > |
The type for the list of aliases. More... | |
using | IFuncListType = SymbolTableList< GlobalIFunc > |
The type for the list of ifuncs. More... | |
using | NamedMDListType = ilist< NamedMDNode > |
The type for the list of named metadata. More... | |
using | ComdatSymTabType = StringMap< Comdat > |
The type of the comdat "symbol" table. More... | |
using | NamedMDSymTabType = StringMap< NamedMDNode * > |
The type for mapping names to named metadata. More... | |
using | global_iterator = GlobalListType::iterator |
The Global Variable iterator. More... | |
using | const_global_iterator = GlobalListType::const_iterator |
The Global Variable constant iterator. More... | |
using | iterator = FunctionListType::iterator |
The Function iterators. More... | |
using | const_iterator = FunctionListType::const_iterator |
The Function constant iterator. More... | |
using | reverse_iterator = FunctionListType::reverse_iterator |
The Function reverse iterator. More... | |
using | const_reverse_iterator = FunctionListType::const_reverse_iterator |
The Function constant reverse iterator. More... | |
using | alias_iterator = AliasListType::iterator |
The Global Alias iterators. More... | |
using | const_alias_iterator = AliasListType::const_iterator |
The Global Alias constant iterator. More... | |
using | ifunc_iterator = IFuncListType::iterator |
The Global IFunc iterators. More... | |
using | const_ifunc_iterator = IFuncListType::const_iterator |
The Global IFunc constant iterator. More... | |
using | named_metadata_iterator = NamedMDListType::iterator |
The named metadata iterators. More... | |
using | const_named_metadata_iterator = NamedMDListType::const_iterator |
The named metadata constant iterators. More... | |
static bool | isValidModFlagBehavior (Metadata *MD, ModFlagBehavior &MFB) |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB. More... | |
static bool | isValidModuleFlag (const MDNode &ModFlag, ModFlagBehavior &MFB, MDString *&Key, Metadata *&Val) |
Check if the given module flag metadata represents a valid module flag, and store the flag behavior, the key string and the value 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.
using llvm::Module::alias_iterator = AliasListType::iterator |
using llvm::Module::const_alias_iterator = AliasListType::const_iterator |
using llvm::Module::const_global_iterator = GlobalListType::const_iterator |
using llvm::Module::const_ifunc_iterator = IFuncListType::const_iterator |
using llvm::Module::const_iterator = FunctionListType::const_iterator |
using llvm::Module::const_reverse_iterator = FunctionListType::const_reverse_iterator |
using llvm::Module::global_iterator = GlobalListType::iterator |
using llvm::Module::ifunc_iterator = IFuncListType::iterator |
using llvm::Module::iterator = FunctionListType::iterator |
using llvm::Module::NamedMDSymTabType = StringMap<NamedMDNode *> |
using llvm::Module::reverse_iterator = FunctionListType::reverse_iterator |
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.
References string.
Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 81 of file Module.cpp.
References dropAllReferences().
void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 365 of file Module.cpp.
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Constant * | Val | ||
) |
Definition at line 356 of file Module.cpp.
References addModuleFlag(), and llvm::ConstantAsMetadata::get().
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 348 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(), setCodeModel(), setModuleFlag(), setPICLevel(), setPIELevel(), setRtLibUseGOT(), and setSemanticInterposition().
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 360 of file Module.cpp.
References addModuleFlag(), llvm::ConstantInt::get(), llvm::Type::getInt32Ty(), and Int32Ty.
|
inline |
Definition at line 628 of file Module.h.
Referenced by aliases(), and LLVMGetPreviousGlobalAlias().
|
inline |
|
inline |
Definition at line 630 of file Module.h.
Referenced by aliases(), and LLVMGetNextGlobalAlias().
|
inline |
|
inline |
Definition at line 635 of file Module.h.
References alias_begin(), alias_end(), and llvm::make_range().
Referenced by dropAllReferences(), and global_values().
|
inline |
Definition at line 638 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 304 of file Module.h.
References llvm::HexStyle::Asm.
|
inline |
Definition at line 606 of file Module.h.
Referenced by functions().
|
inline |
std::unique_ptr< RandomNumberGenerator > Module::createRNG | ( | const StringRef | Name | ) | 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(), and getModuleIdentifier().
|
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 758 of file Module.h.
References getNamedMetadata(), and llvm::make_range().
|
inline |
Definition at line 745 of file Module.h.
References getNamedMetadata().
|
inline |
Definition at line 750 of file Module.h.
References getNamedMetadata().
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 483 of file Module.cpp.
References aliases(), 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 152 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 4749 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 608 of file Module.h.
Referenced by functions().
|
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 271 of file Module.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::StringMap< ValueTy, AllocatorTy >::erase(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::NamedMDNode::getName().
Referenced by llvm::NamedMDNode::eraseFromParent().
|
inline |
Definition at line 617 of file Module.h.
References begin(), end(), and llvm::make_range().
Referenced by global_objects(), and global_values().
|
inline |
Definition at line 620 of file Module.h.
References begin(), end(), and llvm::make_range().
|
inline |
|
inline |
Get the Module's list of aliases (constant).
Definition at line 548 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent(), and llvm::GlobalAlias::removeFromParent().
Optional< CodeModel::Model > Module::getCodeModel | ( | ) | const |
Returns the code model (tiny, small, kernel, medium or large model)
Definition at line 565 of file Module.cpp.
References getModuleFlag(), and llvm::None.
unsigned Module::getCodeViewFlag | ( | ) | const |
Returns the CodeView Version by checking module flags.
Returns zero if not present in module.
Definition at line 517 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::X86FrameLowering::emitPrologue(), and llvm::X86AsmPrinter::runOnMachineFunction().
|
inline |
|
inline |
|
inline |
Get the global data context.
Definition at line 253 of file Module.h.
References Context.
Referenced by llvm::AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), EmitMSInlineAsmStr(), llvm::SanitizerStatReport::finish(), llvm::FunctionImporter::importFunctions(), replaceLongjmpWithEmscriptenLongjmp(), setPartialSampleProfileRatio(), shouldEmitInstrCountChangedRemark(), llvm::CallGraphSCCPass::skipSCC(), and llvm::InlineAdvisorAnalysis::Result::tryCreate().
const DataLayout & Module::getDataLayout | ( | ) | const |
Get the data layout for the module's target platform.
Definition at line 397 of file Module.cpp.
Referenced by AddAlignmentAssumptions(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), CanProveNotTakenFirstIteration(), llvm::CloneAndPruneIntoFromInst(), llvm::FunctionComparator::cmpTypes(), computeRecurrenceType(), llvm::JumpThreadingPass::computeValueKnownInPredecessorsImpl(), llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateAlloca(), llvm::IRBuilderBase::CreateAtomicCmpXchg(), llvm::IRBuilderBase::CreateAtomicRMW(), llvm::InnerLoopVectorizer::createInductionResumeValues(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), llvm::DependenceInfo::depends(), llvm::AsmPrinter::emitAlignment(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::AsmPrinter::emitGlobalVariable(), llvm::emitLinkerFlagsForGlobalCOFF(), llvm::RISCVTargetLowering::emitMaskedAtomicRMWIntrinsic(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::AsmPrinter::emitSpecialLLVMGlobal(), llvm::FindAvailablePtrLoadStore(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::MemoryLocation::get(), getAlign(), getAllocaSizeInBytes(), getAtomicOpSize(), llvm::getConstantDataArrayInfo(), llvm::AsmPrinter::getDataLayout(), llvm::MachineIRBuilder::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::ScalarEvolution::getDataLayout(), getEdgeValueLocal(), getELFSectionNameForGlobal(), getFrameLayout(), llvm::getGEPInductionOperand(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::VNCoercion::getLoadLoadClobberFullWidthSize(), llvm::ExecutionEngine::getMangledName(), llvm::Mangler::getNameWithPrefix(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::getPtrStride(), llvm::DependenceInfo::getSplitIteration(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::RuntimePointerChecking::insert(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), llvm::isDereferenceableAndAlignedInLoop(), llvm::RISCVELFTargetObjectFile::isGlobalInSmallSection(), llvm::HexagonTargetObjectFile::isGlobalInSmallSection(), llvm::InductionDescriptor::isInductionPHI(), llvm::GCNTTIImpl::isInlineAsmSourceOfDivergence(), isLoadInvariantInLoop(), llvm::SystemZSubtarget::isPC32DBLSymbol(), isPointerValueDeadOnEntryToFunction(), isSafePHIToSpeculate(), llvm::isSafeToSpeculativelyExecute(), IsSmallObject(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::gvn::AvailableValue::MaterializeAdjustedValue(), performGlobalAddressCombine(), processInternalGlobal(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), llvm::LoopRotatePass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(), llvm::FunctionLoweringInfo::set(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), llvm::simplifyRetainedKnowledge(), simplifyX86immShift(), simplifyX86varShift(), splitGlobal(), TryToShrinkGlobalToBoolean(), llvm::UnrollRuntimeLoopRemainder(), valueCoversEntireFragment(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::LoopVersioning::versionLoop(), visitIVCast(), 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 240 of file Module.h.
References DL.
unsigned Module::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version by checking module flags.
Definition at line 505 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::DwarfDebug::DwarfDebug().
Look up the specified function in the module symbol table.
If it does not exist, return null.
Definition at line 174 of file Module.cpp.
References getNamedValue().
Referenced by llvm::SelectionDAG::getSymbolFunctionGlobalAddress(), llvm::VFABI::getVectorVariantNames(), and unswitchBestCondition().
|
inline |
|
inline |
Get the Module's list of functions (constant).
Definition at line 540 of file Module.h.
Referenced by llvm::Function::eraseFromParent(), llvm::Function::removeFromParent(), and llvm::CallGraph::removeFunctionFromModule().
|
inline |
|
inline |
Get the Module's list of global variables (constant).
Definition at line 531 of file Module.h.
Referenced by llvm::GlobalVariable::eraseFromParent(), llvm::GlobalVariable::GlobalVariable(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalVariable::removeFromParent(), removeGlobalCtors(), SRAGlobal(), and TryToShrinkGlobalToBoolean().
|
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 395 of file Module.h.
Referenced by getGlobalVariable(), and getNamedGlobal().
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 189 of file Module.cpp.
References getNamedValue().
|
inline |
Definition at line 401 of file Module.h.
References getGlobalVariable().
std::vector< StructType * > Module::getIdentifiedStructTypes | ( | ) | const |
Definition at line 462 of file Module.cpp.
References llvm::TypeFinder::begin(), llvm::TypeFinder::end(), llvm::MipsISD::Ret, and llvm::TypeFinder::run().
|
inline |
|
inline |
Get the Module's list of ifuncs (constant).
Definition at line 557 of file Module.h.
Referenced by llvm::GlobalIFunc::eraseFromParent(), and llvm::GlobalIFunc::removeFromParent().
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 524 of file Module.cpp.
References F.
|
inline |
Retrieves the GVMaterializer, if any, for this Module.
Definition at line 514 of file Module.h.
Referenced by isMaterialized().
unsigned Module::getMDKindID | ( | StringRef | Name | ) | const |
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 119 of file Module.cpp.
References llvm::LLVMContext::getMDKindID().
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 126 of file Module.cpp.
References llvm::LLVMContext::getMDKindNames().
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 321 of file Module.cpp.
References getModuleFlagsMetadata().
Referenced by getCodeModel(), getCodeViewFlag(), getDwarfVersion(), getNumberRegisterParameters(), getPICLevel(), getPIELevel(), getProfileSummary(), getRtLibUseGOT(), getSDKVersion(), getSemanticInterposition(), and isDwarf64().
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 334 of file Module.cpp.
References getNamedMetadata().
Referenced by getModuleFlag(), and getModuleFlagsMetadata().
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 303 of file Module.cpp.
References getModuleFlagsMetadata(), isValidModuleFlag(), and llvm::NamedMDNode::operands().
Referenced by llvm::orc::cloneModuleFlagsMetadata().
|
inline |
Get the module identifier which is, essentially, the name of the module.
Definition at line 219 of file Module.h.
Referenced by createRNG(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), getDebugLocString(), llvm::DOTGraphTraits< CallGraphDOTInfo * >::getGraphName(), llvm::FunctionImporter::importFunctions(), llvm::ThinLTOCodeGenerator::internalize(), llvm::PassManagerPrettyStackEntry::print(), llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print(), and llvm::ThinLTOCodeGenerator::promote().
|
inline |
|
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 236 of file Module.h.
Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), and llvm::ThinLTOCodeGenerator::run().
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 239 of file Module.cpp.
References getNamedValue().
|
inline |
Definition at line 413 of file Module.h.
References getNamedGlobal().
|
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 410 of file Module.h.
References getGlobalVariable().
Referenced by getNamedGlobal(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().
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 243 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 250 of file Module.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::lookup().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::cacheAnnotationFromMD(), debug_compile_units(), debug_compile_units_begin(), debug_compile_units_end(), 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 113 of file Module.cpp.
References getValueSymbolTable(), and lookup().
Referenced by llvm::RecordStreamer::flushSymverDirectives(), getComdatGVForCOFF(), getFunction(), getGlobalVariable(), getNamedAlias(), getNamedIFunc(), getOrInsertFunction(), and getOrInsertGlobal().
unsigned Module::getNumberRegisterParameters | ( | ) | const |
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition at line 497 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 130 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 531 of file Module.cpp.
Referenced by copyComdat().
|
delete |
|
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 361 of file Module.h.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::FunctionType::get(), and getOrInsertFunction().
FunctionCallee Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T | ||
) |
Definition at line 167 of file Module.cpp.
References getOrInsertFunction().
FunctionCallee Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T, | ||
AttributeList | AttributeList | ||
) |
Look up the specified function in the module symbol table.
Four possibilities:
In all cases, the returned value is a FunctionCallee wrapper around the 'FunctionType T' passed in, as well as a 'Value' either of the Function or the bitcast to the function.
Definition at line 143 of file Module.cpp.
References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F, llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), and llvm::DataLayout::getProgramAddressSpace().
Referenced by llvm::SanitizerStatReport::finish(), and getOrInsertFunction().
|
inline |
Same as above, but without the attributes.
Definition at line 372 of file Module.h.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, and getOrInsertFunction().
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 225 of file Module.cpp.
References llvm::GlobalValue::ExternalLinkage, and getOrInsertGlobal().
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 204 of file Module.cpp.
References assert(), llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::Type::getPointerAddressSpace(), and llvm::GlobalValue::getType().
Referenced by 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 341 of file Module.cpp.
References getOrInsertNamedMetadata().
Referenced by addModuleFlag(), and setModuleFlag().
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 259 of file Module.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back().
Referenced by llvm::CloneFunctionInto(), llvm::DIBuilder::createCompileUnit(), and getOrInsertModuleFlagsMetadata().
PICLevel::Level Module::getPICLevel | ( | ) | const |
Returns the PIC level (small or large model)
Definition at line 537 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 551 of file Module.cpp.
References llvm::PIELevel::Default, and getModuleFlag().
Referenced by llvm::TargetMachine::getTLSModel().
Metadata * Module::getProfileSummary | ( | bool | IsCS | ) | const |
Returns profile summary metadata.
When IsCS is true, use the context sensitive profile summary.
Definition at line 590 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::ProfileSummaryInfo::refresh(), and setPartialSampleProfileRatio().
bool Module::getRtLibUseGOT | ( | ) | const |
Returns true if PLT should be avoided for RTLib calls.
Definition at line 613 of file Module.cpp.
References getModuleFlag().
VersionTuple Module::getSDKVersion | ( | ) | const |
Get the build SDK version metadata.
An empty version is returned if no such metadata is attached.
Definition at line 636 of file Module.cpp.
References getModuleFlag(), Index, and llvm::None.
bool Module::getSemanticInterposition | ( | ) | const |
Returns whether semantic interposition is to be respected.
Definition at line 595 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::GlobalValue::isInterposable().
|
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 230 of file Module.h.
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and llvm::thinLTOInternalizeModule().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Get the target triple which is a string describing the target host.
Definition at line 249 of file Module.h.
Referenced by llvm::GlobalObject::canIncreaseAlignment(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::LTOModule::getTargetTriple(), insertSinCosCall(), llvm::ThinLTOCodeGenerator::internalize(), isCallingConvCCompatible(), llvm::ThinLTOCodeGenerator::optimize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::LLParser::Run().
|
inline |
|
inline |
Get the symbol table of global variable and function identifiers.
Definition at line 575 of file Module.h.
Referenced by getNamedValue().
|
inline |
Definition at line 588 of file Module.h.
Referenced by globals(), and LLVMGetPreviousGlobal().
|
inline |
|
inline |
Definition at line 590 of file Module.h.
Referenced by globals(), and LLVMGetNextGlobal().
|
inline |
iterator_range< Module::const_global_object_iterator > Module::global_objects | ( | ) |
Definition at line 412 of file Module.cpp.
References functions(), and globals().
iterator_range<const_global_object_iterator> llvm::Module::global_objects | ( | ) | const |
iterator_range< Module::const_global_value_iterator > Module::global_values | ( | ) |
Definition at line 420 of file Module.cpp.
References aliases(), functions(), globals(), and ifuncs().
Referenced by llvm::RecordStreamer::flushSymverDirectives().
iterator_range<const_global_value_iterator> llvm::Module::global_values | ( | ) | const |
|
inline |
Definition at line 595 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
Referenced by dropAllReferences(), global_objects(), and global_values().
|
inline |
Definition at line 598 of file Module.h.
References global_begin(), global_end(), and llvm::make_range().
|
inline |
Definition at line 646 of file Module.h.
Referenced by ifuncs(), and LLVMGetPreviousGlobalIFunc().
|
inline |
|
inline |
Definition at line 648 of file Module.h.
Referenced by ifuncs(), and LLVMGetNextGlobalIFunc().
|
inline |
|
inline |
Definition at line 653 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
Referenced by dropAllReferences(), and global_values().
|
inline |
Definition at line 656 of file Module.h.
References ifunc_begin(), ifunc_end(), and llvm::make_range().
bool Module::isDwarf64 | ( | ) | const |
Returns the DWARF format by checking module flags.
Definition at line 512 of file Module.cpp.
References getModuleFlag().
Referenced by llvm::DwarfDebug::DwarfDebug().
|
inline |
Definition at line 515 of file Module.h.
References getMaterializer().
|
static |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition at line 276 of file Module.cpp.
References ModFlagBehaviorFirstVal, and ModFlagBehaviorLastVal.
Referenced by isValidModuleFlag().
|
static |
Check if the given module flag metadata represents a valid module flag, and store the flag behavior, the key string and the value metadata.
Definition at line 287 of file Module.cpp.
References llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and isValidModFlagBehavior().
Referenced by getModuleFlagsMetadata(), and setModuleFlag().
Error Module::materialize | ( | GlobalValue * | GV | ) |
Make sure the GlobalValue is fully read.
Definition at line 438 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 445 of file Module.cpp.
References M, move, and llvm::Error::success().
Error Module::materializeMetadata | ( | ) |
Definition at line 452 of file Module.cpp.
References llvm::Error::success().
|
inline |
Definition at line 700 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
|
inline |
Definition at line 703 of file Module.h.
References llvm::make_range(), named_metadata_begin(), and named_metadata_end().
|
inline |
Definition at line 687 of file Module.h.
Referenced by LLVMGetPreviousNamedMetadata(), and named_metadata().
|
inline |
|
inline |
Definition at line 692 of file Module.h.
Referenced by LLVMGetNextNamedMetadata(), and named_metadata().
|
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 4508 of file AsmWriter.cpp.
References llvm::RISCVFenceField::W.
Referenced by dump().
|
inline |
|
inline |
|
inline |
|
inline |
void Module::setCodeModel | ( | CodeModel::Model | CL | ) |
Set the code model (tiny, small, kernel, medium or large)
Definition at line 575 of file Module.cpp.
References addModuleFlag(), and llvm::lltok::Error.
void Module::setDataLayout | ( | const DataLayout & | Other | ) |
Definition at line 395 of file Module.cpp.
References Other.
void Module::setDataLayout | ( | StringRef | Desc | ) |
Set the data layout.
Definition at line 391 of file Module.cpp.
References llvm::DataLayout::reset().
Referenced by llvm::LLParser::Run().
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 431 of file Module.cpp.
References assert().
void Module::setModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Metadata * | Val | ||
) |
Like addModuleFlag but replaces the old module flag if it already exists.
Definition at line 374 of file Module.cpp.
References addModuleFlag(), E, llvm::NamedMDNode::getNumOperands(), llvm::NamedMDNode::getOperand(), getOrInsertModuleFlagsMetadata(), llvm::MDString::getString(), I, and isValidModuleFlag().
Referenced by setProfileSummary().
|
inline |
|
inline |
Set the module-scope inline assembly blocks.
A trailing newline is added if the input doesn't have one.
Definition at line 296 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 609 of file Module.cpp.
References move.
void Module::setPartialSampleProfileRatio | ( | const ModuleSummaryIndex & | Index | ) |
Set the partial sample profile ratio in the profile summary module flag, if applicable.
Definition at line 676 of file Module.cpp.
References double, getContext(), llvm::ProfileSummary::getFromMD(), llvm::ProfileSummary::getKind(), llvm::ProfileSummary::getMD(), llvm::ProfileSummary::getNumCounts(), getProfileSummary(), Index, llvm::ProfileSummary::isPartialProfile(), llvm::ProfileSummary::PSK_Sample, llvm::ProfileSummary::setPartialProfileRatio(), and setProfileSummary().
void Module::setPICLevel | ( | PICLevel::Level | PL | ) |
Set the PIC level (small or large model)
Definition at line 547 of file Module.cpp.
References addModuleFlag(), and llvm::AArch64CC::PL.
void Module::setPIELevel | ( | PIELevel::Level | PL | ) |
Set the PIE level (small or large model)
Definition at line 561 of file Module.cpp.
References addModuleFlag(), and llvm::AArch64CC::PL.
void Module::setProfileSummary | ( | Metadata * | M, |
ProfileSummary::Kind | Kind | ||
) |
Attach profile summary metadata to this module.
Definition at line 583 of file Module.cpp.
References llvm::lltok::Error, M, llvm::ProfileSummary::PSK_CSInstr, and setModuleFlag().
Referenced by setPartialSampleProfileRatio().
void Module::setRtLibUseGOT | ( | ) |
Set that PLT should be avoid for RTLib calls.
Definition at line 618 of file Module.cpp.
References addModuleFlag().
void Module::setSDKVersion | ( | const VersionTuple & | V | ) |
Attach a build SDK version metadata to this module.
Definition at line 622 of file Module.cpp.
void Module::setSemanticInterposition | ( | bool | SI | ) |
Set whether semantic interposition is to be respected.
Definition at line 605 of file Module.cpp.
References addModuleFlag(), llvm::lltok::Error, and SI.
|
inline |
|
inline |
Set the target triple.
Definition at line 292 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 272 of file Module.h.
References getContext(), llvm::LLVMContext::getDiagHandlerPtr(), and llvm::DiagnosticHandler::isAnalysisRemarkEnabled().
|
inline |
Definition at line 614 of file Module.h.
Referenced by llvm::ThinLTOCodeGenerator::run().