LLVM 22.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 | |
bool | getSemanticInterposition () const |
Returns whether semantic interposition is to be respected. | |
void | setSemanticInterposition (bool) |
Set whether semantic interposition is to be respected. | |
bool | getRtLibUseGOT () const |
Returns true if PLT should be avoided for RTLib calls. | |
void | setRtLibUseGOT () |
Set that PLT should be avoid for RTLib calls. | |
bool | getDirectAccessExternalData () const |
Get/set whether referencing global variables can use direct access relocations on ELF targets. | |
void | setDirectAccessExternalData (bool Value) |
UWTableKind | getUwtable () const |
Get/set whether synthesized functions should get the uwtable attribute. | |
void | setUwtable (UWTableKind Kind) |
FramePointerKind | getFramePointer () const |
Get/set whether synthesized functions should get the "frame-pointer" attribute. | |
void | setFramePointer (FramePointerKind Kind) |
StringRef | getStackProtectorGuard () const |
Get/set what kind of stack protector guard to use. | |
void | setStackProtectorGuard (StringRef Kind) |
StringRef | getStackProtectorGuardReg () const |
Get/set which register to use as the stack protector guard register. | |
void | setStackProtectorGuardReg (StringRef Reg) |
StringRef | getStackProtectorGuardSymbol () const |
Get/set a symbol to use as the stack protector guard. | |
void | setStackProtectorGuardSymbol (StringRef Symbol) |
int | getStackProtectorGuardOffset () const |
Get/set what offset from the stack protector to use. | |
void | setStackProtectorGuardOffset (int Offset) |
unsigned | getOverrideStackAlignment () const |
Get/set the stack alignment overridden from the default. | |
void | setOverrideStackAlignment (unsigned Align) |
unsigned | getMaxTLSAlignment () const |
void | setOwnedMemoryBuffer (std::unique_ptr< MemoryBuffer > MB) |
Take ownership of the given memory buffer. | |
void | setPartialSampleProfileRatio (const ModuleSummaryIndex &Index) |
Set the partial sample profile ratio in the profile summary module flag, if applicable. | |
StringRef | getDarwinTargetVariantTriple () const |
Get the target variant triple which is a string describing a variant of the target host platform. | |
void | setDarwinTargetVariantTriple (StringRef T) |
Set the target variant triple which is a string describing a variant of the target host platform. | |
VersionTuple | getDarwinTargetVariantSDKVersion () const |
Get the target variant version build SDK version metadata. | |
void | setDarwinTargetVariantSDKVersion (VersionTuple Version) |
Set the target variant version build SDK version metadata. | |
StringRef | getTargetABIFromMD () |
Returns target-abi from MDString, null if target-abi is absent. | |
WinX64EHUnwindV2Mode | getWinX64EHUnwindV2Mode () const |
Get how unwind v2 (epilog) information should be generated for x64 Windows. | |
Constructors | |
void | removeDebugIntrinsicDeclarations () |
Used when printing this module in the new debug info format; removes all declarations of debug intrinsics that are replaced by non-intrinsic records in the new format. | |
void | convertToNewDbgValues () |
void | convertFromNewDbgValues () |
Module (StringRef ModuleID, LLVMContext &C) | |
The Module constructor. | |
~Module () | |
The module destructor. This will dropAllReferences. | |
Module & | operator= (Module &&Other) |
Move assignment. | |
Module Level Accessors | |
const std::string & | getModuleIdentifier () const |
Get the module identifier which is, essentially, the name of the module. | |
unsigned | getInstructionCount () const |
Returns the number of non-debug IR instructions in the module. | |
const std::string & | getSourceFileName () const |
Get the module's original source file name. | |
StringRef | getName () const |
Get a short "name" for the module. | |
const std::string & | getDataLayoutStr () const |
Get the data layout string for the module's target platform. | |
const DataLayout & | getDataLayout () const |
Get the data layout for the module's target platform. | |
const Triple & | getTargetTriple () const |
Get the target triple which is a string describing the target host. | |
LLVMContext & | getContext () const |
Get the global data context. | |
const std::string & | getModuleInlineAsm () const |
Get any module-scope inline assembly blocks. | |
std::unique_ptr< RandomNumberGenerator > | createRNG (const StringRef Name) const |
Get a RandomNumberGenerator salted for use with this module. | |
bool | shouldEmitInstrCountChangedRemark () |
Return true if size-info optimization remark is enabled, false otherwise. | |
Module Level Mutators | |
void | setModuleIdentifier (StringRef ID) |
Set the module identifier. | |
void | setSourceFileName (StringRef Name) |
Set the module's original source file name. | |
void | setDataLayout (StringRef Desc) |
Set the data layout. | |
void | setDataLayout (const DataLayout &Other) |
void | setTargetTriple (Triple T) |
Set the target triple. | |
void | setModuleInlineAsm (StringRef Asm) |
Set the module-scope inline assembly blocks. | |
void | appendModuleInlineAsm (StringRef Asm) |
Append to the module-scope inline assembly blocks. | |
Generic Value Accessors | |
GlobalValue * | getNamedValue (StringRef Name) const |
Return the global value in the module with the specified name, of arbitrary type. | |
unsigned | getNumNamedValues () const |
Return the number of global values in the module. | |
unsigned | getMDKindID (StringRef Name) const |
Return a unique non-zero ID for the specified metadata kind. | |
void | getMDKindNames (SmallVectorImpl< StringRef > &Result) const |
Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext. | |
void | getOperandBundleTags (SmallVectorImpl< StringRef > &Result) const |
Populate client supplied SmallVector with the bundle tags registered in this LLVMContext. | |
std::vector< StructType * > | getIdentifiedStructTypes () const |
std::string | getUniqueIntrinsicName (StringRef BaseName, Intrinsic::ID Id, const FunctionType *Proto) |
Return a unique name for an intrinsic whose mangling is based on an unnamed type. | |
Function Accessors | |
FunctionCallee | getOrInsertFunction (StringRef Name, FunctionType *T, AttributeList AttributeList) |
Look up the specified function in the module symbol table. | |
FunctionCallee | getOrInsertFunction (StringRef Name, FunctionType *T) |
template<typename... ArgsTy> | |
FunctionCallee | getOrInsertFunction (StringRef Name, AttributeList AttributeList, Type *RetTy, ArgsTy... Args) |
Same as above, but takes a list of function arguments, which makes it easier for clients to use. | |
template<typename... ArgsTy> | |
FunctionCallee | getOrInsertFunction (StringRef Name, Type *RetTy, ArgsTy... Args) |
Same as above, but without the attributes. | |
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. | |
Global Variable Accessors | |
GlobalVariable * | getGlobalVariable (StringRef Name) const |
Look up the specified global variable in the module symbol table. | |
GlobalVariable * | getGlobalVariable (StringRef Name, bool AllowInternal) const |
getGlobalVariable - Look up the specified global variable in the module symbol table. | |
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. | |
GlobalVariable * | getNamedGlobal (StringRef Name) |
GlobalVariable * | getOrInsertGlobal (StringRef Name, Type *Ty, function_ref< GlobalVariable *()> CreateGlobalCallback) |
Look up the specified global in the module symbol table. | |
GlobalVariable * | getOrInsertGlobal (StringRef Name, Type *Ty) |
Look up the specified global in the module symbol table. | |
Global Alias Accessors | |
GlobalAlias * | getNamedAlias (StringRef Name) const |
Return the global alias in the module with the specified name, of arbitrary type. | |
Global IFunc Accessors | |
GlobalIFunc * | getNamedIFunc (StringRef Name) const |
Return the global ifunc in the module with the specified name, of arbitrary type. | |
Named Metadata Accessors | |
NamedMDNode * | getNamedMetadata (StringRef Name) const |
Return the first NamedMDNode in the module with the specified name. | |
NamedMDNode * | getOrInsertNamedMetadata (StringRef Name) |
Return the named MDNode in the module with the specified name. | |
void | eraseNamedMetadata (NamedMDNode *NMD) |
Remove the given NamedMDNode from this module and delete it. | |
Comdat Accessors | |
Comdat * | getOrInsertComdat (StringRef Name) |
Return the Comdat in the module with the specified name. | |
Module Flags Accessors | |
void | getModuleFlagsMetadata (SmallVectorImpl< ModuleFlagEntry > &Flags) const |
Returns the module flags in the provided vector. | |
Metadata * | getModuleFlag (StringRef Key) const |
Return the corresponding value if Key appears in module flags, otherwise return null. | |
NamedMDNode * | getModuleFlagsMetadata () const |
Returns the NamedMDNode in the module that represents module-level flags. | |
NamedMDNode * | getOrInsertModuleFlagsMetadata () |
Returns the NamedMDNode in the module that represents module-level flags. | |
void | addModuleFlag (ModFlagBehavior Behavior, StringRef Key, Metadata *Val) |
Add a module-level flag to the module-level flags metadata. | |
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. | |
void | setModuleFlag (ModFlagBehavior Behavior, StringRef Key, Constant *Val) |
void | setModuleFlag (ModFlagBehavior Behavior, StringRef Key, uint32_t Val) |
Materialization | |
void | setMaterializer (GVMaterializer *GVM) |
Sets the GVMaterializer to GVM. | |
GVMaterializer * | getMaterializer () const |
Retrieves the GVMaterializer, if any, for this Module. | |
bool | isMaterialized () const |
llvm::Error | materialize (GlobalValue *GV) |
Make sure the GlobalValue is fully read. | |
llvm::Error | materializeAll () |
Make sure all GlobalValues in this Module are fully read and clear the Materializer. | |
llvm::Error | materializeMetadata () |
void | removeGlobalVariable (GlobalVariable *GV) |
Detach global variable GV from the list but don't delete it. | |
void | eraseGlobalVariable (GlobalVariable *GV) |
Remove global variable GV from the list and delete it. | |
void | insertGlobalVariable (GlobalVariable *GV) |
Insert global variable GV at the end of the global variable list and take ownership. | |
void | insertGlobalVariable (GlobalListType::iterator Where, GlobalVariable *GV) |
Insert global variable GV into the global variable list before Where and take ownership. | |
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. | |
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. | |
void | dump () const |
Dump the module to stderr (for debugging). | |
void | dropAllReferences () |
This function causes all the subinstructions to "let go" of all references that they are maintaining. | |
Utility functions for querying Debug information. | |
unsigned | getNumberRegisterParameters () const |
Returns the Number of Register ParametersDwarf Version by checking module flags. | |
unsigned | getDwarfVersion () const |
Returns the Dwarf Version by checking module flags. | |
bool | isDwarf64 () const |
Returns the DWARF format by checking module flags. | |
unsigned | getCodeViewFlag () const |
Returns the CodeView Version by checking module flags. | |
Utility functions for querying and setting PIC level | |
PICLevel::Level | getPICLevel () const |
Returns the PIC level (small or large model) | |
void | setPICLevel (PICLevel::Level PL) |
Set the PIC level (small or large model) | |
Utility functions for querying and setting PIE level | |
PIELevel::Level | getPIELevel () const |
Returns the PIE level (small or large model) | |
void | setPIELevel (PIELevel::Level PL) |
Set the PIE level (small or large model) | |
Utility function for querying and setting code model | |
std::optional< CodeModel::Model > | getCodeModel () const |
Returns the code model (tiny, small, kernel, medium or large model) | |
void | setCodeModel (CodeModel::Model CL) |
Set the code model (tiny, small, kernel, medium or large) | |
Utility function for querying and setting the large data threshold | |
std::optional< uint64_t > | getLargeDataThreshold () const |
Returns the large data threshold. | |
void | setLargeDataThreshold (uint64_t Threshold) |
Set the large data threshold. | |
Utility functions for querying and setting PGO summary | |
void | setProfileSummary (Metadata *M, ProfileSummary::Kind Kind) |
Attach profile summary metadata to this module. | |
Metadata * | getProfileSummary (bool IsCS) const |
Returns profile summary metadata. | |
Utility functions for querying and setting the build SDK version | |
void | setSDKVersion (const VersionTuple &V) |
Attach a build SDK version metadata to this module. | |
VersionTuple | getSDKVersion () const |
Get the build SDK version metadata. | |
Types And Enumerations | |
enum | ModFlagBehavior { Error = 1 , Warning = 2 , Require = 3 , Override = 4 , Append = 5 , AppendUnique = 6 , Max = 7 , Min = 8 , ModFlagBehaviorFirstVal = Error , ModFlagBehaviorLastVal = Min } |
This enumeration defines the supported behaviors of module flags. More... | |
using | GlobalListType = SymbolTableList< GlobalVariable > |
The type for the list of global variables. | |
using | FunctionListType = SymbolTableList< Function > |
The type for the list of functions. | |
using | AliasListType = SymbolTableList< GlobalAlias > |
The type for the list of aliases. | |
using | IFuncListType = SymbolTableList< GlobalIFunc > |
The type for the list of ifuncs. | |
using | NamedMDListType = ilist< NamedMDNode > |
The type for the list of named metadata. | |
using | ComdatSymTabType = StringMap< Comdat > |
The type of the comdat "symbol" table. | |
using | NamedMDSymTabType = StringMap< NamedMDNode * > |
The type for mapping names to named metadata. | |
using | global_iterator = GlobalListType::iterator |
The Global Variable iterator. | |
using | const_global_iterator = GlobalListType::const_iterator |
The Global Variable constant iterator. | |
using | iterator = FunctionListType::iterator |
The Function iterators. | |
using | const_iterator = FunctionListType::const_iterator |
The Function constant iterator. | |
using | reverse_iterator = FunctionListType::reverse_iterator |
The Function reverse iterator. | |
using | const_reverse_iterator = FunctionListType::const_reverse_iterator |
The Function constant reverse iterator. | |
using | alias_iterator = AliasListType::iterator |
The Global Alias iterators. | |
using | const_alias_iterator = AliasListType::const_iterator |
The Global Alias constant iterator. | |
using | ifunc_iterator = IFuncListType::iterator |
The Global IFunc iterators. | |
using | const_ifunc_iterator = IFuncListType::const_iterator |
The Global IFunc constant iterator. | |
using | named_metadata_iterator = NamedMDListType::iterator |
The named metadata iterators. | |
using | const_named_metadata_iterator = NamedMDListType::const_iterator |
The named metadata constant iterators. | |
static bool | isValidModFlagBehavior (Metadata *MD, ModFlagBehavior &MFB) |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB. | |
Member Variables | |
class | Constant |
Direct access to the globals list, functions list, and symbol table | |
class | llvm::SymbolTableListTraits< llvm::GlobalVariable > |
class | llvm::SymbolTableListTraits< llvm::GlobalAlias > |
class | llvm::SymbolTableListTraits< llvm::GlobalIFunc > |
static FunctionListType Module::* | getSublistAccess (Function *) |
const FunctionListType & | getFunctionList () const |
Get the Module's list of functions (constant). | |
FunctionListType & | getFunctionList () |
Get the Module's list of functions. | |
void | removeAlias (GlobalAlias *Alias) |
Detach Alias from the list but don't delete it. | |
void | eraseAlias (GlobalAlias *Alias) |
Remove Alias from the list and delete it. | |
void | insertAlias (GlobalAlias *Alias) |
Insert Alias at the end of the alias list and take ownership. | |
void | removeIFunc (GlobalIFunc *IFunc) |
Detach IFunc from the list but don't delete it. | |
void | eraseIFunc (GlobalIFunc *IFunc) |
Remove IFunc from the list and delete it. | |
void | insertIFunc (GlobalIFunc *IFunc) |
Insert IFunc at the end of the alias list and take ownership. | |
void | removeNamedMDNode (NamedMDNode *MDNode) |
Detach MDNode from the list but don't delete it. | |
void | eraseNamedMDNode (NamedMDNode *MDNode) |
Remove MDNode from the list and delete it. | |
void | insertNamedMDNode (NamedMDNode *MDNode) |
Insert MDNode at the end of the alias list and take ownership. | |
const ValueSymbolTable & | getValueSymbolTable () const |
Get the symbol table of global variable and function identifiers. | |
ValueSymbolTable & | getValueSymbolTable () |
Get the Module's symbol table of global variable and function identifiers. | |
const ComdatSymTabType & | getComdatSymbolTable () const |
Get the Module's symbol table for COMDATs (constant). | |
ComdatSymTabType & | getComdatSymbolTable () |
Get the Module's symbol table for COMDATs. | |
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 GlobalList 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 GlobalList. The main container class for the LLVM Intermediate Representation.
using llvm::Module::NamedMDSymTabType = StringMap<NamedMDNode *> |
This enumeration defines the supported behaviors of module flags.
|
explicit |
The Module constructor.
Note that there is no default constructor. You must provide a name for the module upon construction.
Definition at line 72 of file Module.cpp.
Module::~Module | ( | ) |
The module destructor. This will dropAllReferences.
Definition at line 112 of file Module.cpp.
void Module::addModuleFlag | ( | MDNode * | Node | ) |
Definition at line 392 of file Module.cpp.
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Constant * | Val | ||
) |
Definition at line 383 of file Module.cpp.
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 375 of file Module.cpp.
void Module::addModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 387 of file Module.cpp.
|
inline |
Definition at line 717 of file Module.h.
Referenced by LLVMGetPreviousGlobalAlias().
|
inline |
|
inline |
Definition at line 719 of file Module.h.
Referenced by LLVMGetNextGlobalAlias().
|
inline |
|
inline |
Definition at line 724 of file Module.h.
References llvm::make_range().
Referenced by llvm::sandboxir::Context::createModule(), and llvm::thinLTOFinalizeInModule().
|
inline |
Definition at line 727 of file Module.h.
References llvm::make_range().
|
inline |
|
inline |
|
inline |
|
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 149 of file Module.cpp.
|
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 852 of file Module.h.
References llvm::make_range().
Referenced by llvm::MachineFunction::needsFrameMoves().
|
inline |
|
inline |
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 561 of file Module.cpp.
void Module::dump | ( | ) | const |
Dump the module to stderr (for debugging).
Definition at line 5484 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
|
inline |
|
inline |
Remove Alias
from the list and delete it.
Definition at line 606 of file Module.h.
Referenced by llvm::GlobalAlias::eraseFromParent().
|
inline |
Remove global variable GV
from the list and delete it.
Definition at line 565 of file Module.h.
Referenced by llvm::GlobalVariable::eraseFromParent().
|
inline |
Remove IFunc
from the list and delete it.
Definition at line 615 of file Module.h.
Referenced by llvm::GlobalIFunc::eraseFromParent().
|
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 316 of file Module.cpp.
Referenced by llvm::NamedMDNode::eraseFromParent().
|
inline |
Definition at line 706 of file Module.h.
References llvm::make_range().
|
inline |
Definition at line 709 of file Module.h.
References llvm::make_range().
std::optional< CodeModel::Model > Module::getCodeModel | ( | ) | const |
Returns the code model (tiny, small, kernel, medium or large model)
Definition at line 645 of file Module.cpp.
Referenced by llvm::setGlobalVariableLargeSection().
unsigned Module::getCodeViewFlag | ( | ) | const |
Returns the CodeView Version by checking module flags.
Returns zero if not present in module.
Definition at line 595 of file Module.cpp.
Referenced by llvm::X86FrameLowering::emitPrologue().
|
inline |
|
inline |
|
inline |
Get the global data context.
Definition at line 285 of file Module.h.
References Context.
Referenced by llvm::AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::OpenMPIRBuilder::createAtomicCompare(), llvm::OpenMPIRBuilder::createAtomicRead(), llvm::OpenMPIRBuilder::createAtomicWrite(), llvm::OpenMPIRBuilder::createCopyinClauseBlocks(), llvm::OpenMPIRBuilder::createGlobalFlag(), llvm::OpenMPIRBuilder::createLoopSkeleton(), llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata(), llvm::OpenMPIRBuilder::createOffloadMapnames(), llvm::OpenMPIRBuilder::createOffloadMaptypes(), llvm::OpenMPIRBuilder::createOMPInteropDestroy(), llvm::OpenMPIRBuilder::createOMPInteropInit(), llvm::OpenMPIRBuilder::createOMPInteropUse(), llvm::OpenMPIRBuilder::createParallel(), llvm::OpenMPIRBuilder::createReductions(), llvm::OpenMPIRBuilder::createReductionsGPU(), llvm::OpenMPIRBuilder::createSections(), llvm::OpenMPIRBuilder::createTask(), crossImportIntoModule(), llvm::WebAssemblyAsmPrinter::emitGlobalVariable(), llvm::OpenMPIRBuilder::emitIfClause(), llvm::OpenMPIRBuilder::emitNonContiguousDescriptor(), llvm::OpenMPIRBuilder::emitOffloadingArraysArgument(), llvm::OpenMPIRBuilder::emitTargetTask(), llvm::OpenMPIRBuilder::emitUserDefinedMapper(), llvm::SanitizerStatReport::finish(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), llvm::FunctionImporter::importFunctions(), llvm::MLInlineAdvisor::MLInlineAdvisor(), optimizeModule(), populateReductionFunction(), llvm::dxil::DXILOpBuilder::tryCreateOp(), updateSubprogramLinkageName(), and verifyLoadedModule().
VersionTuple Module::getDarwinTargetVariantSDKVersion | ( | ) | const |
Get the target variant version build SDK version metadata.
An empty version is returned if no such metadata is attached.
Definition at line 909 of file Module.cpp.
StringRef Module::getDarwinTargetVariantTriple | ( | ) | const |
Get the target variant triple which is a string describing a variant of the target host platform.
For example, Mac Catalyst can be a variant target triple for a macOS target.
Definition at line 898 of file Module.cpp.
|
inline |
Get the data layout for the module's target platform.
Definition at line 278 of file Module.h.
References DL.
Referenced by CanProveNotTakenFirstIteration(), llvm::OpenMPIRBuilder::createAtomicRead(), llvm::OpenMPIRBuilder::createAtomicWrite(), llvm::OpenMPIRBuilder::createParallel(), llvm::OpenMPIRBuilder::createReductions(), llvm::OpenMPIRBuilder::createReductionsGPU(), llvm::OpenMPIRBuilder::createTask(), emitMemcpyExpansion(), emitMemsetExpansion(), llvm::OpenMPIRBuilder::emitNonContiguousDescriptor(), llvm::OpenMPIRBuilder::emitOffloadingArrays(), llvm::OpenMPIRBuilder::emitTargetKernel(), llvm::OpenMPIRBuilder::emitTargetTask(), llvm::OpenMPIRBuilder::emitUserDefinedMapper(), getAuthPtrSlotSymbolHelper(), llvm::AsmPrinter::getDataLayout(), llvm::GlobalValue::getDataLayout(), llvm::sandboxir::Module::getDataLayout(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::OpenMPIRBuilder::getOrCreateIdent(), llvm::OpenMPIRBuilder::getOrCreateInternalVariable(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), isAtomicRMWLegalXChgTy(), llvm::OpenMPIRBuilder::registerTargetGlobalVariable(), and valueCoversEntireFragment().
|
inline |
Get the data layout string for the module's target platform.
This is equivalent to getDataLayout()->getStringRepresentation().
Definition at line 273 of file Module.h.
References DL.
bool Module::getDirectAccessExternalData | ( | ) | const |
Get/set whether referencing global variables can use direct access relocations on ELF targets.
Definition at line 719 of file Module.cpp.
unsigned Module::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version by checking module flags.
Definition at line 583 of file Module.cpp.
Referenced by llvm::DwarfDebug::DwarfDebug().
FramePointerKind Module::getFramePointer | ( | ) | const |
Get/set whether synthesized functions should get the "frame-pointer" attribute.
Definition at line 741 of file Module.cpp.
Look up the specified function in the module symbol table.
If it does not exist, return null.
Definition at line 229 of file Module.cpp.
Referenced by llvm::OpenMPIRBuilder::createTargetInit(), llvm::SelectionDAG::getSymbolFunctionGlobalAddress(), llvm::VFABI::getVectorVariantNames(), and llvm::LoopVectorizationCostModel::setVectorizedCallDecision().
|
inline |
|
inline |
Get the Module's list of functions (constant).
Definition at line 596 of file Module.h.
Referenced by llvm::OpenMPIRBuilder::finalize(), moveFunctionAdaptingType(), and llvm::CallGraph::removeFunctionFromModule().
|
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 430 of file Module.h.
References getGlobalVariable(), and Name.
Referenced by llvm::OpenMPIRBuilder::finalize().
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 244 of file Module.cpp.
|
inline |
Definition at line 436 of file Module.h.
References getGlobalVariable(), and Name.
std::vector< StructType * > Module::getIdentifiedStructTypes | ( | ) | const |
Definition at line 490 of file Module.cpp.
unsigned Module::getInstructionCount | ( | ) | const |
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 602 of file Module.cpp.
std::optional< uint64_t > Module::getLargeDataThreshold | ( | ) | const |
Returns the large data threshold.
Definition at line 663 of file Module.cpp.
|
inline |
Retrieves the GVMaterializer, if any, for this Module.
unsigned Module::getMaxTLSAlignment | ( | ) | const |
Definition at line 805 of file Module.cpp.
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 181 of file Module.cpp.
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 188 of file Module.cpp.
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition at line 352 of file Module.cpp.
Referenced by llvm::calculateSEHStateNumbers(), llvm::calculateWinCXXEHStateNumbers(), llvm::CC_RISCV(), and llvm::AsmPrinter::emitFunctionBody().
|
inline |
Returns the NamedMDNode in the module that represents module-level flags.
This method returns null if there are no module-level flags.
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 335 of file Module.cpp.
|
inline |
Get the module identifier which is, essentially, the name of the module.
Definition at line 252 of file Module.h.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::DOTGraphTraits< CallGraphDOTInfo * >::getGraphName(), llvm::Loop::getLocStr(), llvm::FunctionImporter::importFunctions(), llvm::ThinLTOCodeGenerator::internalize(), llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print(), llvm::PassManagerPrettyStackEntry::print(), llvm::ThinLTOCodeGenerator::promote(), and llvm::cgdata::saveModuleForTwoRounds().
|
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 269 of file Module.h.
Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::AsmPrinter::emitStackUsage(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), llvm::ThinLTOCodeGenerator::run(), and llvm::FunctionSpecializer::~FunctionSpecializer().
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 284 of file Module.cpp.
|
inline |
|
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 445 of file Module.h.
References getGlobalVariable(), and Name.
Referenced by llvm::OpenMPIRBuilder::createTargetDeinit(), and llvm::TargetLowering::LowerToTLSEmulatedModel().
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 288 of file Module.cpp.
NamedMDNode * Module::getNamedMetadata | ( | StringRef | 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 295 of file Module.cpp.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::CodeViewDebug::beginModule(), llvm::cacheAnnotationFromMD(), and llvm::OpenMPIRBuilder::loadOffloadInfoMetadata().
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 171 of file Module.cpp.
Referenced by llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata(), llvm::RecordStreamer::flushSymverDirectives(), llvm::OpenMPIRBuilder::getAddrOfDeclareTargetVar(), getComdatGVForCOFF(), and llvm::OpenMPIRBuilder::registerTargetGlobalVariable().
unsigned Module::getNumberRegisterParameters | ( | ) | const |
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition at line 575 of file Module.cpp.
unsigned Module::getNumNamedValues | ( | ) | const |
Return the number of global values in the module.
Definition at line 175 of file Module.cpp.
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 192 of file Module.cpp.
Return the Comdat in the module with the specified name.
It is created if it didn't already exist.
Definition at line 609 of file Module.cpp.
|
delete |
|
inline |
FunctionCallee Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T | ||
) |
Definition at line 222 of file Module.cpp.
FunctionCallee Module::getOrInsertFunction | ( | StringRef | Name, |
FunctionType * | T, | ||
AttributeList | AttributeList | ||
) |
Look up the specified function in the module symbol table.
If it does not exist, add a prototype for the function and return it. Otherwise, return the existing function.
In all cases, the returned value is a FunctionCallee wrapper around the 'FunctionType T' passed in, as well as the 'Value' of the Function. The function type of the function may differ from the function type stored in FunctionCallee if it was previously created with a different type.
Note: For library calls getOrInsertLibFunc() should be used instead.
Definition at line 205 of file Module.cpp.
Referenced by llvm::SanitizerStatReport::finish(), InsertCall(), insertCallBeforeInstruction(), and llvm::dxil::DXILOpBuilder::tryCreateOp().
|
inline |
GlobalVariable * Module::getOrInsertGlobal | ( | StringRef | Name, |
Type * | Ty | ||
) |
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 270 of file Module.cpp.
GlobalVariable * 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.
If it does not exist, add a declaration of the global and return it. Otherwise, return the existing global.
Definition at line 256 of file Module.cpp.
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 366 of file Module.cpp.
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 302 of file Module.cpp.
Referenced by llvm::CloneFunctionInto(), llvm::DIBuilder::createCompileUnit(), and llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata().
unsigned Module::getOverrideStackAlignment | ( | ) | const |
Get/set the stack alignment overridden from the default.
Definition at line 798 of file Module.cpp.
PICLevel::Level Module::getPICLevel | ( | ) | const |
Returns the PIC level (small or large model)
Definition at line 615 of file Module.cpp.
PIELevel::Level Module::getPIELevel | ( | ) | const |
Returns the PIE level (small or large model)
Definition at line 631 of file Module.cpp.
Referenced by llvm::TargetMachine::getTLSModel(), and ProcessThinLTOModule().
Returns profile summary metadata.
When IsCS is true, use the context sensitive profile summary.
Definition at line 687 of file Module.cpp.
Referenced by llvm::ProfileSummaryInfo::refresh().
bool Module::getRtLibUseGOT | ( | ) | const |
Returns true if PLT should be avoided for RTLib calls.
Definition at line 710 of file Module.cpp.
VersionTuple Module::getSDKVersion | ( | ) | const |
Get the build SDK version metadata.
An empty version is returned if no such metadata is attached.
Definition at line 859 of file Module.cpp.
bool Module::getSemanticInterposition | ( | ) | const |
Returns whether semantic interposition is to be respected.
Definition at line 692 of file Module.cpp.
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 263 of file Module.h.
Referenced by llvm::sandboxir::Module::getSourceFileName(), llvm::getStrippedSourceFileName(), llvm::FunctionImporter::importFunctions(), selectExplicitSectionGlobal(), and llvm::thinLTOInternalizeModule().
StringRef Module::getStackProtectorGuard | ( | ) | const |
Get/set what kind of stack protector guard to use.
Definition at line 751 of file Module.cpp.
int Module::getStackProtectorGuardOffset | ( | ) | const |
Get/set what offset from the stack protector to use.
Definition at line 787 of file Module.cpp.
StringRef Module::getStackProtectorGuardReg | ( | ) | const |
Get/set which register to use as the stack protector guard register.
The empty string is equivalent to "global". Other values may be "tls" or "sysreg".
Definition at line 763 of file Module.cpp.
StringRef Module::getStackProtectorGuardSymbol | ( | ) | const |
Get/set a symbol to use as the stack protector guard.
Definition at line 775 of file Module.cpp.
|
inlinestatic |
StringRef Module::getTargetABIFromMD | ( | ) |
Returns target-abi from MDString, null if target-abi is absent.
Definition at line 917 of file Module.cpp.
Get the target triple which is a string describing the target host.
Definition at line 281 of file Module.h.
Referenced by llvm::ModuleSymbolTable::addModule(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::GlobalObject::canIncreaseAlignment(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::CodeViewDebug::endFunctionImpl(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::OpenMPIRBuilder::getOrCreateInternalVariable(), llvm::LTOModule::getTargetTriple(), insertSinCosCall(), llvm::ThinLTOCodeGenerator::internalize(), llvm::TargetLibraryInfoImpl::isCallingConvCCompatible(), llvm::ThinLTOCodeGenerator::optimize(), and llvm::ThinLTOCodeGenerator::promote().
std::string Module::getUniqueIntrinsicName | ( | StringRef | BaseName, |
Intrinsic::ID | Id, | ||
const FunctionType * | Proto | ||
) |
Return a unique name for an intrinsic whose mangling is based on an unnamed type.
The Proto represents the function prototype.
Definition at line 504 of file Module.cpp.
UWTableKind Module::getUwtable | ( | ) | const |
Get/set whether synthesized functions should get the uwtable attribute.
Definition at line 731 of file Module.cpp.
|
inline |
|
inline |
WinX64EHUnwindV2Mode Module::getWinX64EHUnwindV2Mode | ( | ) | const |
Get how unwind v2 (epilog) information should be generated for x64 Windows.
Definition at line 925 of file Module.cpp.
|
inline |
Definition at line 677 of file Module.h.
Referenced by LLVMGetPreviousGlobal().
|
inline |
|
inline |
Definition at line 679 of file Module.h.
Referenced by LLVMGetNextGlobal().
|
inline |
iterator_range< Module::global_object_iterator > Module::global_objects | ( | ) |
Definition at line 440 of file Module.cpp.
Referenced by llvm::thinLTOFinalizeInModule().
iterator_range< Module::const_global_object_iterator > Module::global_objects | ( | ) | const |
Definition at line 444 of file Module.cpp.
iterator_range< Module::global_value_iterator > Module::global_values | ( | ) |
Definition at line 448 of file Module.cpp.
Referenced by llvm::RecordStreamer::flushSymverDirectives().
iterator_range< Module::const_global_value_iterator > Module::global_values | ( | ) | const |
Definition at line 452 of file Module.cpp.
|
inline |
Definition at line 684 of file Module.h.
References llvm::make_range().
Referenced by llvm::sandboxir::Context::createModule(), llvm::OpenMPIRBuilder::getOrCreateIdent(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), and llvm::thinLTOFinalizeInModule().
|
inline |
Definition at line 687 of file Module.h.
References llvm::make_range().
|
inline |
Definition at line 735 of file Module.h.
Referenced by LLVMGetPreviousGlobalIFunc().
|
inline |
|
inline |
Definition at line 737 of file Module.h.
Referenced by LLVMGetNextGlobalIFunc().
|
inline |
|
inline |
Definition at line 742 of file Module.h.
References llvm::make_range().
Referenced by llvm::sandboxir::Context::createModule().
|
inline |
Definition at line 745 of file Module.h.
References llvm::make_range().
|
inline |
|
inline |
|
inline |
Insert global variable GV
at the end of the global variable list and take ownership.
Definition at line 568 of file Module.h.
Referenced by llvm::GlobalVariable::GlobalVariable(), OptimizeGlobalAddressOfAllocation(), removeGlobalCtors(), and TryToShrinkGlobalToBoolean().
|
inline |
|
inline |
bool Module::isDwarf64 | ( | ) | const |
Returns the DWARF format by checking module flags.
Definition at line 590 of file Module.cpp.
Referenced by llvm::DwarfDebug::DwarfDebug().
|
static |
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition at line 323 of file Module.cpp.
Error Module::materialize | ( | GlobalValue * | GV | ) |
Make sure the GlobalValue is fully read.
Definition at line 466 of file Module.cpp.
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 473 of file Module.cpp.
Error Module::materializeMetadata | ( | ) |
Definition at line 480 of file Module.cpp.
|
inline |
Definition at line 789 of file Module.h.
References llvm::make_range().
|
inline |
Definition at line 792 of file Module.h.
References llvm::make_range().
|
inline |
Definition at line 776 of file Module.h.
Referenced by LLVMGetPreviousNamedMetadata().
|
inline |
|
inline |
Definition at line 781 of file Module.h.
Referenced by LLVMGetNextNamedMetadata().
|
inline |
Move assignment.
Definition at line 78 of file Module.cpp.
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 5073 of file AsmWriter.cpp.
References OS.
Referenced by dump().
|
inline |
|
inline |
|
inline |
Detach Alias
from the list but don't delete it.
Definition at line 604 of file Module.h.
Referenced by llvm::GlobalAlias::removeFromParent().
void Module::removeDebugIntrinsicDeclarations | ( | ) |
Used when printing this module in the new debug info format; removes all declarations of debug intrinsics that are replaced by non-intrinsic records in the new format.
Definition at line 121 of file Module.cpp.
|
inline |
Detach global variable GV
from the list but don't delete it.
Definition at line 563 of file Module.h.
Referenced by llvm::GlobalVariable::removeFromParent().
|
inline |
Detach IFunc
from the list but don't delete it.
Definition at line 613 of file Module.h.
Referenced by llvm::GlobalIFunc::removeFromParent().
|
inline |
|
inline |
|
inline |
void Module::setCodeModel | ( | CodeModel::Model | CL | ) |
Set the code model (tiny, small, kernel, medium or large)
Definition at line 655 of file Module.cpp.
void Module::setDarwinTargetVariantSDKVersion | ( | VersionTuple | Version | ) |
Set the target variant version build SDK version metadata.
Definition at line 913 of file Module.cpp.
void Module::setDarwinTargetVariantTriple | ( | StringRef | T | ) |
Set the target variant triple which is a string describing a variant of the target host platform.
Definition at line 904 of file Module.cpp.
void Module::setDataLayout | ( | const DataLayout & | Other | ) |
Definition at line 425 of file Module.cpp.
void Module::setDataLayout | ( | StringRef | Desc | ) |
Set the data layout.
Definition at line 423 of file Module.cpp.
void Module::setDirectAccessExternalData | ( | bool | Value | ) |
Definition at line 727 of file Module.cpp.
void Module::setFramePointer | ( | FramePointerKind | Kind | ) |
Definition at line 747 of file Module.cpp.
void Module::setLargeDataThreshold | ( | uint64_t | Threshold | ) |
Set the large data threshold.
Definition at line 673 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 459 of file Module.cpp.
void Module::setModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Constant * | Val | ||
) |
Definition at line 413 of file Module.cpp.
void Module::setModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
Metadata * | Val | ||
) |
Like addModuleFlag but replaces the old module flag if it already exists.
Definition at line 401 of file Module.cpp.
void Module::setModuleFlag | ( | ModFlagBehavior | Behavior, |
StringRef | Key, | ||
uint32_t | Val | ||
) |
Definition at line 417 of file Module.cpp.
|
inline |
|
inline |
void Module::setOverrideStackAlignment | ( | unsigned | Align | ) |
Definition at line 812 of file Module.cpp.
void Module::setOwnedMemoryBuffer | ( | std::unique_ptr< MemoryBuffer > | MB | ) |
Take ownership of the given memory buffer.
Definition at line 706 of file Module.cpp.
void Module::setPartialSampleProfileRatio | ( | const ModuleSummaryIndex & | Index | ) |
Set the partial sample profile ratio in the profile summary module flag, if applicable.
Definition at line 878 of file Module.cpp.
void Module::setPICLevel | ( | PICLevel::Level | PL | ) |
Set the PIC level (small or large model)
Definition at line 625 of file Module.cpp.
void Module::setPIELevel | ( | PIELevel::Level | PL | ) |
Set the PIE level (small or large model)
Definition at line 641 of file Module.cpp.
void Module::setProfileSummary | ( | Metadata * | M, |
ProfileSummary::Kind | Kind | ||
) |
Attach profile summary metadata to this module.
Definition at line 680 of file Module.cpp.
void Module::setRtLibUseGOT | ( | ) |
Set that PLT should be avoid for RTLib calls.
Definition at line 715 of file Module.cpp.
void Module::setSDKVersion | ( | const VersionTuple & | V | ) |
Attach a build SDK version metadata to this module.
Definition at line 830 of file Module.cpp.
void Module::setSemanticInterposition | ( | bool | SI | ) |
Set whether semantic interposition is to be respected.
Definition at line 702 of file Module.cpp.
|
inline |
void Module::setStackProtectorGuard | ( | StringRef | Kind | ) |
Definition at line 758 of file Module.cpp.
void Module::setStackProtectorGuardOffset | ( | int | Offset | ) |
Definition at line 794 of file Module.cpp.
void Module::setStackProtectorGuardReg | ( | StringRef | Reg | ) |
Definition at line 770 of file Module.cpp.
void Module::setStackProtectorGuardSymbol | ( | StringRef | Symbol | ) |
Definition at line 782 of file Module.cpp.
|
inline |
Set the target triple.
Definition at line 324 of file Module.h.
Referenced by llvm::LTOModule::setTargetTriple().
void Module::setUwtable | ( | UWTableKind | Kind | ) |
Definition at line 737 of file Module.cpp.
|
inline |
|
friend |
|
friend |
|
friend |