class Module
Declaration
class Module { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/Module.h:66
Method Overview
- public Module(llvm::StringRef ModuleID, llvm::LLVMContext & C)
- public void addModuleFlag(llvm::Module::ModFlagBehavior Behavior, llvm::StringRef Key, llvm::Metadata * Val)
- public void addModuleFlag(llvm::Module::ModFlagBehavior Behavior, llvm::StringRef Key, llvm::Constant * Val)
- public void addModuleFlag(llvm::Module::ModFlagBehavior Behavior, llvm::StringRef Key, uint32_t Val)
- public void addModuleFlag(llvm::MDNode * Node)
- public int alias_begin() const
- public int alias_begin()
- public bool alias_empty() const
- public int alias_end() const
- public int alias_end()
- public size_t alias_size() const
- public int aliases() const
- public int aliases()
- public void appendModuleInlineAsm(llvm::StringRef Asm)
- public int begin()
- public int begin() const
- public int createRNG(const llvm::Pass * P) const
- public iterator_range<llvm::Module::debug_compile_units_iterator> debug_compile_units() const
- public llvm::Module::debug_compile_units_iterator debug_compile_units_begin() const
- public llvm::Module::debug_compile_units_iterator debug_compile_units_end() const
- public void dropAllReferences()
- public void dropTriviallyDeadConstantArrays()
- public void dump() const
- public bool empty() const
- public int end() const
- public int end()
- public void eraseNamedMetadata(llvm::NamedMDNode * NMD)
- public int functions()
- public int functions() const
- public llvm::Module::AliasListType & getAliasList()
- public const llvm::Module::AliasListType & getAliasList() const
- public Optional<CodeModel::Model> getCodeModel() const
- public unsigned int getCodeViewFlag() const
- public int & getComdatSymbolTable()
- public const int & getComdatSymbolTable() const
- public llvm::LLVMContext & getContext() const
- public const llvm::DataLayout & getDataLayout() const
- public const std::string & getDataLayoutStr() const
- public unsigned int getDwarfVersion() const
- public llvm::Function * getFunction(llvm::StringRef Name) const
- public llvm::Module::FunctionListType & getFunctionList()
- public const llvm::Module::FunctionListType & getFunctionList() const
- public llvm::Module::GlobalListType & getGlobalList()
- public const llvm::Module::GlobalListType & getGlobalList() const
- public llvm::GlobalVariable * getGlobalVariable(llvm::StringRef Name, bool AllowInternal = false)
- public llvm::GlobalVariable * getGlobalVariable(llvm::StringRef Name, bool AllowInternal) const
- public llvm::GlobalVariable * getGlobalVariable(llvm::StringRef Name) const
- public llvm::Module::IFuncListType & getIFuncList()
- public const llvm::Module::IFuncListType & getIFuncList() const
- public int getIdentifiedStructTypes() const
- public unsigned int getInstructionCount()
- public unsigned int getMDKindID(llvm::StringRef Name) const
- public void getMDKindNames(SmallVectorImpl<llvm::StringRef> & Result) const
- public llvm::GVMaterializer * getMaterializer() const
- public llvm::Metadata * getModuleFlag(llvm::StringRef Key) const
- public llvm::NamedMDNode * getModuleFlagsMetadata() const
- public void getModuleFlagsMetadata(SmallVectorImpl<llvm::Module::ModuleFlagEntry> & Flags) const
- public const std::string & getModuleIdentifier() const
- public const std::string & getModuleInlineAsm() const
- public llvm::StringRef getName() const
- public llvm::GlobalAlias * getNamedAlias(llvm::StringRef Name) const
- public const llvm::GlobalVariable * getNamedGlobal(llvm::StringRef Name) const
- public llvm::GlobalVariable * getNamedGlobal(llvm::StringRef Name)
- public llvm::GlobalIFunc * getNamedIFunc(llvm::StringRef Name) const
- public int & getNamedMDList()
- public const int & getNamedMDList() const
- public llvm::NamedMDNode * getNamedMetadata(const llvm::Twine & Name) const
- public llvm::GlobalValue * getNamedValue(llvm::StringRef Name) const
- public unsigned int getNumberRegisterParameters() const
- public void getOperandBundleTags(SmallVectorImpl<llvm::StringRef> & Result) const
- public llvm::Comdat * getOrInsertComdat(llvm::StringRef Name)
- public template <typename... ArgsTy>llvm::FunctionCallee getOrInsertFunction(llvm::StringRef Name, llvm::AttributeList AttributeList, llvm::FunctionType * Invalid, ArgsTy... Args)
- public llvm::FunctionCallee getOrInsertFunction(llvm::StringRef Name, llvm::FunctionType * T, llvm::AttributeList AttributeList)
- public template <typename... ArgsTy>llvm::FunctionCallee getOrInsertFunction(llvm::StringRef Name, llvm::AttributeList AttributeList, llvm::Type * RetTy, ArgsTy... Args)
- public template <typename... ArgsTy>llvm::FunctionCallee getOrInsertFunction(llvm::StringRef Name, llvm::Type * RetTy, ArgsTy... Args)
- public llvm::FunctionCallee getOrInsertFunction(llvm::StringRef Name, llvm::FunctionType * T)
- public llvm::Constant * getOrInsertGlobal(llvm::StringRef Name, llvm::Type * Ty, function_ref<llvm::GlobalVariable *()> CreateGlobalCallback)
- public llvm::Constant * getOrInsertGlobal(llvm::StringRef Name, llvm::Type * Ty)
- public llvm::NamedMDNode * getOrInsertModuleFlagsMetadata()
- public llvm::NamedMDNode * getOrInsertNamedMetadata(llvm::StringRef Name)
- public PICLevel::Level getPICLevel() const
- public PIELevel::Level getPIELevel() const
- public llvm::Metadata * getProfileSummary(bool IsCS)
- public bool getRtLibUseGOT() const
- public llvm::VersionTuple getSDKVersion() const
- public const std::string & getSourceFileName() const
- public static int llvm::Module::* getSublistAccess(llvm::NamedMDNode *)
- public static llvm::Module::FunctionListType llvm::Module::* getSublistAccess(llvm::Function *)
- public static llvm::Module::AliasListType llvm::Module::* getSublistAccess(llvm::GlobalAlias *)
- public static llvm::Module::IFuncListType llvm::Module::* getSublistAccess(llvm::GlobalIFunc *)
- public static llvm::Module::GlobalListType llvm::Module::* getSublistAccess(llvm::GlobalVariable *)
- public const std::string & getTargetTriple() const
- public llvm::StructType * getTypeByName(llvm::StringRef Name) const
- public const llvm::ValueSymbolTable & getValueSymbolTable() const
- public llvm::ValueSymbolTable & getValueSymbolTable()
- public int global_begin()
- public int global_begin() const
- public bool global_empty() const
- public int global_end()
- public int global_end() const
- public int global_objects() const
- public int global_objects()
- public int global_values() const
- public int global_values()
- public int globals() const
- public int globals()
- public int ifunc_begin()
- public int ifunc_begin() const
- public bool ifunc_empty() const
- public int ifunc_end() const
- public int ifunc_end()
- public size_t ifunc_size() const
- public int ifuncs() const
- public int ifuncs()
- public bool isMaterialized() const
- public static bool isValidModFlagBehavior(llvm::Metadata * MD, llvm::Module::ModFlagBehavior & MFB)
- public llvm::Error materialize(llvm::GlobalValue * GV)
- public llvm::Error materializeAll()
- public llvm::Error materializeMetadata()
- public int named_metadata() const
- public int named_metadata()
- public int named_metadata_begin() const
- public int named_metadata_begin()
- public bool named_metadata_empty() const
- public int named_metadata_end() const
- public int named_metadata_end()
- public size_t named_metadata_size() const
- public void print(llvm::raw_ostream & OS, llvm::AssemblyAnnotationWriter * AAW, bool ShouldPreserveUseListOrder = false, bool IsForDebug = false) const
- public int rbegin() const
- public int rbegin()
- public int rend() const
- public int rend()
- public void setCodeModel(CodeModel::Model CL)
- public void setDataLayout(llvm::StringRef Desc)
- public void setDataLayout(const llvm::DataLayout & Other)
- public void setMaterializer(llvm::GVMaterializer * GVM)
- public void setModuleIdentifier(llvm::StringRef ID)
- public void setModuleInlineAsm(llvm::StringRef Asm)
- public void setOwnedMemoryBuffer(int MB)
- public void setPICLevel(PICLevel::Level PL)
- public void setPIELevel(PIELevel::Level PL)
- public void setProfileSummary(llvm::Metadata * M, ProfileSummary::Kind Kind)
- public void setRtLibUseGOT()
- public void setSDKVersion(const llvm::VersionTuple & V)
- public void setSourceFileName(llvm::StringRef Name)
- public void setTargetTriple(llvm::StringRef T)
- public bool shouldEmitInstrCountChangedRemark()
- public size_t size() const
- public ~Module()
Methods
¶Module(llvm::StringRef ModuleID,
llvm::LLVMContext& C)
Module(llvm::StringRef ModuleID,
llvm::LLVMContext& C)
Description
The Module constructor. Note that there is no default constructor. You must provide a name for the module upon construction.
Declared at: llvm/include/llvm/IR/Module.h:201
Parameters
- llvm::StringRef ModuleID
- llvm::LLVMContext& C
¶void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
llvm::Metadata* Val)
void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
llvm::Metadata* Val)
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:490
Parameters
- llvm::Module::ModFlagBehavior Behavior
- llvm::StringRef Key
- llvm::Metadata* Val
¶void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
llvm::Constant* Val)
void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
llvm::Constant* Val)
Declared at: llvm/include/llvm/IR/Module.h:491
Parameters
- llvm::Module::ModFlagBehavior Behavior
- llvm::StringRef Key
- llvm::Constant* Val
¶void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
uint32_t Val)
void addModuleFlag(
llvm::Module::ModFlagBehavior Behavior,
llvm::StringRef Key,
uint32_t Val)
Declared at: llvm/include/llvm/IR/Module.h:492
Parameters
- llvm::Module::ModFlagBehavior Behavior
- llvm::StringRef Key
- uint32_t Val
¶void addModuleFlag(llvm::MDNode* Node)
void addModuleFlag(llvm::MDNode* Node)
Declared at: llvm/include/llvm/IR/Module.h:493
Parameters
- llvm::MDNode* Node
¶int alias_begin() const
int alias_begin() const
Declared at: llvm/include/llvm/IR/Module.h:622
¶int alias_begin()
int alias_begin()
Declared at: llvm/include/llvm/IR/Module.h:621
¶bool alias_empty() const
bool alias_empty() const
Declared at: llvm/include/llvm/IR/Module.h:626
¶int alias_end() const
int alias_end() const
Declared at: llvm/include/llvm/IR/Module.h:624
¶int alias_end()
int alias_end()
Declared at: llvm/include/llvm/IR/Module.h:623
¶size_t alias_size() const
size_t alias_size() const
Declared at: llvm/include/llvm/IR/Module.h:625
¶int aliases() const
int aliases() const
Declared at: llvm/include/llvm/IR/Module.h:631
¶int aliases()
int aliases()
Declared at: llvm/include/llvm/IR/Module.h:628
¶void appendModuleInlineAsm(llvm::StringRef Asm)
void appendModuleInlineAsm(llvm::StringRef Asm)
Description
Append to the module-scope inline assembly blocks. A trailing newline is added if the input doesn't have one.
Declared at: llvm/include/llvm/IR/Module.h:296
Parameters
- llvm::StringRef Asm
¶int begin()
int begin()
Declared at: llvm/include/llvm/IR/Module.h:599
¶int begin() const
int begin() const
Declared at: llvm/include/llvm/IR/Module.h:600
¶int createRNG(const llvm::Pass* P) const
int createRNG(const llvm::Pass* P) const
Declared at: llvm/include/llvm/IR/Module.h:260
Parameters
- const llvm::Pass* P
¶iterator_range<
llvm::Module::debug_compile_units_iterator>
debug_compile_units() const
iterator_range<
llvm::Module::debug_compile_units_iterator>
debug_compile_units() const
Declared at: llvm/include/llvm/IR/Module.h:751
¶llvm::Module::debug_compile_units_iterator
debug_compile_units_begin() const
llvm::Module::debug_compile_units_iterator
debug_compile_units_begin() const
Declared at: llvm/include/llvm/IR/Module.h:738
¶llvm::Module::debug_compile_units_iterator
debug_compile_units_end() const
llvm::Module::debug_compile_units_iterator
debug_compile_units_end() const
Declared at: llvm/include/llvm/IR/Module.h:743
¶void dropAllReferences()
void dropAllReferences()
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:788
¶void dropTriviallyDeadConstantArrays()
void dropTriviallyDeadConstantArrays()
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:766
¶void dump() const
void dump() const
Description
Dump the module to stderr (for debugging).
Declared at: llvm/include/llvm/IR/Module.h:780
¶bool empty() const
bool empty() const
Declared at: llvm/include/llvm/IR/Module.h:608
¶int end() const
int end() const
Declared at: llvm/include/llvm/IR/Module.h:602
¶int end()
int end()
Declared at: llvm/include/llvm/IR/Module.h:601
¶void eraseNamedMetadata(llvm::NamedMDNode* NMD)
void eraseNamedMetadata(llvm::NamedMDNode* NMD)
Description
Remove the given NamedMDNode from this module and delete it.
Declared at: llvm/include/llvm/IR/Module.h:458
Parameters
- llvm::NamedMDNode* NMD
¶int functions()
int functions()
Declared at: llvm/include/llvm/IR/Module.h:610
¶int functions() const
int functions() const
Declared at: llvm/include/llvm/IR/Module.h:613
¶llvm::Module::AliasListType& getAliasList()
llvm::Module::AliasListType& getAliasList()
Description
Get the Module's list of aliases.
Declared at: llvm/include/llvm/IR/Module.h:544
¶const llvm::Module::AliasListType& getAliasList()
const
const llvm::Module::AliasListType& getAliasList()
const
Description
Get the Module's list of aliases (constant).
Declared at: llvm/include/llvm/IR/Module.h:542
¶Optional<CodeModel::Model> getCodeModel() const
Optional<CodeModel::Model> getCodeModel() const
Description
Returns the code model (tiny, small, kernel, medium or large model)
Declared at: llvm/include/llvm/IR/Module.h:832
¶unsigned int getCodeViewFlag() const
unsigned int getCodeViewFlag() const
Description
Returns the CodeView Version by checking module flags. Returns zero if not present in module.
Declared at: llvm/include/llvm/IR/Module.h:803
¶int& getComdatSymbolTable()
int& getComdatSymbolTable()
Declared at: llvm/include/llvm/IR/Module.h:576
¶const int& getComdatSymbolTable() const
const int& getComdatSymbolTable() const
Declared at: llvm/include/llvm/IR/Module.h:574
¶llvm::LLVMContext& getContext() const
llvm::LLVMContext& getContext() const
Description
Get the global data context.
Declared at: llvm/include/llvm/IR/Module.h:245
Returns
LLVMContext - a container for LLVM's global information
¶const llvm::DataLayout& getDataLayout() const
const llvm::DataLayout& getDataLayout() const
Description
Get the data layout for the module's target platform.
Declared at: llvm/include/llvm/IR/Module.h:237
¶const std::string& getDataLayoutStr() const
const std::string& getDataLayoutStr() const
Description
Get the data layout string for the module's target platform. This is equivalent to getDataLayout()->getStringRepresentation().
Declared at: llvm/include/llvm/IR/Module.h:232
¶unsigned int getDwarfVersion() const
unsigned int getDwarfVersion() const
Description
Returns the Dwarf Version by checking module flags.
Declared at: llvm/include/llvm/IR/Module.h:799
¶llvm::Function* getFunction(
llvm::StringRef Name) const
llvm::Function* getFunction(
llvm::StringRef Name) const
Description
Look up the specified function in the module symbol table. If it does not exist, return null.
Declared at: llvm/include/llvm/IR/Module.h:381
Parameters
- llvm::StringRef Name
¶llvm::Module::FunctionListType& getFunctionList()
llvm::Module::FunctionListType& getFunctionList()
Description
Get the Module's list of functions.
Declared at: llvm/include/llvm/IR/Module.h:536
¶const llvm::Module::FunctionListType&
getFunctionList() const
const llvm::Module::FunctionListType&
getFunctionList() const
Description
Get the Module's list of functions (constant).
Declared at: llvm/include/llvm/IR/Module.h:534
¶llvm::Module::GlobalListType& getGlobalList()
llvm::Module::GlobalListType& getGlobalList()
Description
Get the Module's list of global variables.
Declared at: llvm/include/llvm/IR/Module.h:527
¶const llvm::Module::GlobalListType&
getGlobalList() const
const llvm::Module::GlobalListType&
getGlobalList() const
Description
Get the Module's list of global variables (constant).
Declared at: llvm/include/llvm/IR/Module.h:525
¶llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name,
bool AllowInternal = false)
llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name,
bool AllowInternal = false)
Declared at: llvm/include/llvm/IR/Module.h:397
Parameters
- llvm::StringRef Name
- bool AllowInternal = false
¶llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name,
bool AllowInternal) const
llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name,
bool AllowInternal) const
Declared at: llvm/include/llvm/IR/Module.h:395
Parameters
- llvm::StringRef Name
- bool AllowInternal
¶llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name) const
llvm::GlobalVariable* getGlobalVariable(
llvm::StringRef Name) const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:391
Parameters
- llvm::StringRef Name
¶llvm::Module::IFuncListType& getIFuncList()
llvm::Module::IFuncListType& getIFuncList()
Description
Get the Module's list of ifuncs.
Declared at: llvm/include/llvm/IR/Module.h:553
¶const llvm::Module::IFuncListType& getIFuncList()
const
const llvm::Module::IFuncListType& getIFuncList()
const
Description
Get the Module's list of ifuncs (constant).
Declared at: llvm/include/llvm/IR/Module.h:551
¶int getIdentifiedStructTypes() const
int getIdentifiedStructTypes() const
Declared at: llvm/include/llvm/IR/Module.h:328
¶unsigned int getInstructionCount()
unsigned int getInstructionCount()
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:216
¶unsigned int getMDKindID(
llvm::StringRef Name) const
unsigned int getMDKindID(
llvm::StringRef Name) const
Description
Return a unique non-zero ID for the specified metadata kind. This ID is uniqued across modules in the current LLVMContext.
Declared at: llvm/include/llvm/IR/Module.h:313
Parameters
- llvm::StringRef Name
¶void getMDKindNames(
SmallVectorImpl<llvm::StringRef>& Result)
const
void getMDKindNames(
SmallVectorImpl<llvm::StringRef>& Result)
const
Description
Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext.
Declared at: llvm/include/llvm/IR/Module.h:317
Parameters
- SmallVectorImpl<llvm::StringRef>& Result
¶llvm::GVMaterializer* getMaterializer() const
llvm::GVMaterializer* getMaterializer() const
Description
Retrieves the GVMaterializer, if any, for this Module.
Declared at: llvm/include/llvm/IR/Module.h:508
¶llvm::Metadata* getModuleFlag(
llvm::StringRef Key) const
llvm::Metadata* getModuleFlag(
llvm::StringRef Key) const
Description
Return the corresponding value if Key appears in module flags, otherwise return null.
Declared at: llvm/include/llvm/IR/Module.h:477
Parameters
- llvm::StringRef Key
¶llvm::NamedMDNode* getModuleFlagsMetadata() const
llvm::NamedMDNode* getModuleFlagsMetadata() const
Description
Returns the NamedMDNode in the module that represents module-level flags. This method returns null if there are no module-level flags.
Declared at: llvm/include/llvm/IR/Module.h:481
¶void getModuleFlagsMetadata(
SmallVectorImpl<
llvm::Module::ModuleFlagEntry>& Flags)
const
void getModuleFlagsMetadata(
SmallVectorImpl<
llvm::Module::ModuleFlagEntry>& Flags)
const
Description
Returns the module flags in the provided vector.
Declared at: llvm/include/llvm/IR/Module.h:473
Parameters
- SmallVectorImpl<llvm::Module::ModuleFlagEntry>& Flags
¶const std::string& getModuleIdentifier() const
const std::string& getModuleIdentifier() const
Description
Get the module identifier which is, essentially, the name of the module.
Declared at: llvm/include/llvm/IR/Module.h:211
Returns
the module identifier as a string
¶const std::string& getModuleInlineAsm() const
const std::string& getModuleInlineAsm() const
Description
Get any module-scope inline assembly blocks.
Declared at: llvm/include/llvm/IR/Module.h:249
Returns
a string containing the module-scope inline assembly blocks.
¶llvm::StringRef getName() const
llvm::StringRef getName() const
Description
Get a short "name" for the module. This is useful for debugging or logging. It is essentially a convenience wrapper around getModuleIdentifier().
Declared at: llvm/include/llvm/IR/Module.h:228
¶llvm::GlobalAlias* getNamedAlias(
llvm::StringRef Name) const
llvm::GlobalAlias* getNamedAlias(
llvm::StringRef Name) const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:433
Parameters
- llvm::StringRef Name
¶const llvm::GlobalVariable* getNamedGlobal(
llvm::StringRef Name) const
const llvm::GlobalVariable* getNamedGlobal(
llvm::StringRef Name) const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:406
Parameters
- llvm::StringRef Name
¶llvm::GlobalVariable* getNamedGlobal(
llvm::StringRef Name)
llvm::GlobalVariable* getNamedGlobal(
llvm::StringRef Name)
Declared at: llvm/include/llvm/IR/Module.h:409
Parameters
- llvm::StringRef Name
¶llvm::GlobalIFunc* getNamedIFunc(
llvm::StringRef Name) const
llvm::GlobalIFunc* getNamedIFunc(
llvm::StringRef Name) const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:442
Parameters
- llvm::StringRef Name
¶int& getNamedMDList()
int& getNamedMDList()
Declared at: llvm/include/llvm/IR/Module.h:562
¶const int& getNamedMDList() const
const int& getNamedMDList() const
Declared at: llvm/include/llvm/IR/Module.h:560
¶llvm::NamedMDNode* getNamedMetadata(
const llvm::Twine& Name) const
llvm::NamedMDNode* getNamedMetadata(
const llvm::Twine& Name) const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:450
Parameters
- const llvm::Twine& Name
¶llvm::GlobalValue* getNamedValue(
llvm::StringRef Name) const
llvm::GlobalValue* getNamedValue(
llvm::StringRef Name) const
Description
Return the global value in the module with the specified name, of arbitrary type. This method returns null if a global with the specified name is not found.
Declared at: llvm/include/llvm/IR/Module.h:309
Parameters
- llvm::StringRef Name
¶unsigned int getNumberRegisterParameters() const
unsigned int getNumberRegisterParameters() const
Description
Returns the Number of Register ParametersDwarf Version by checking module flags.
Declared at: llvm/include/llvm/IR/Module.h:796
¶void getOperandBundleTags(
SmallVectorImpl<llvm::StringRef>& Result)
const
void getOperandBundleTags(
SmallVectorImpl<llvm::StringRef>& Result)
const
Description
Populate client supplied SmallVector with the bundle tags registered in this LLVMContext. The bundle tags are ordered by increasing bundle IDs.
Declared at: llvm/include/llvm/IR/Module.h:322
Parameters
- SmallVectorImpl<llvm::StringRef>& Result
¶llvm::Comdat* getOrInsertComdat(
llvm::StringRef Name)
llvm::Comdat* getOrInsertComdat(
llvm::StringRef Name)
Description
Return the Comdat in the module with the specified name. It is created if it didn't already exist.
Declared at: llvm/include/llvm/IR/Module.h:466
Parameters
- llvm::StringRef Name
¶template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::AttributeList AttributeList,
llvm::FunctionType* Invalid,
ArgsTy... Args)
template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::AttributeList AttributeList,
llvm::FunctionType* Invalid,
ArgsTy... Args)
Declared at: llvm/include/llvm/IR/Module.h:376
Templates
- ArgsTy
Parameters
- llvm::StringRef Name
- llvm::AttributeList AttributeList
- llvm::FunctionType* Invalid
- ArgsTy... Args
¶llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::FunctionType* T,
llvm::AttributeList AttributeList)
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::FunctionType* T,
llvm::AttributeList AttributeList)
Description
Look up the specified function in the module symbol table. Four possibilities: 1. If it does not exist, add a prototype for the function and return it. 2. Otherwise, if the existing function has the correct prototype, return the existing function. 3. Finally, the function exists but has the wrong prototype: return the function with a constantexpr cast to the right prototype. 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.
Declared at: llvm/include/llvm/IR/Module.h:345
Parameters
- llvm::StringRef Name
- llvm::FunctionType* T
- llvm::AttributeList AttributeList
¶template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::AttributeList AttributeList,
llvm::Type* RetTy,
ArgsTy... Args)
template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::AttributeList AttributeList,
llvm::Type* RetTy,
ArgsTy... Args)
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:357
Templates
- ArgsTy
Parameters
- llvm::StringRef Name
- llvm::AttributeList AttributeList
- llvm::Type* RetTy
- ArgsTy... Args
¶template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::Type* RetTy,
ArgsTy... Args)
template <typename... ArgsTy>
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::Type* RetTy,
ArgsTy... Args)
Description
Same as above, but without the attributes.
Declared at: llvm/include/llvm/IR/Module.h:368
Templates
- ArgsTy
Parameters
- llvm::StringRef Name
- llvm::Type* RetTy
- ArgsTy... Args
¶llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::FunctionType* T)
llvm::FunctionCallee getOrInsertFunction(
llvm::StringRef Name,
llvm::FunctionType* T)
Declared at: llvm/include/llvm/IR/Module.h:348
Parameters
¶llvm::Constant* getOrInsertGlobal(
llvm::StringRef Name,
llvm::Type* Ty,
function_ref<llvm::GlobalVariable*()>
CreateGlobalCallback)
llvm::Constant* getOrInsertGlobal(
llvm::StringRef Name,
llvm::Type* Ty,
function_ref<llvm::GlobalVariable*()>
CreateGlobalCallback)
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:419
Parameters
- llvm::StringRef Name
- llvm::Type* Ty
- function_ref<llvm::GlobalVariable*()> CreateGlobalCallback
¶llvm::Constant* getOrInsertGlobal(
llvm::StringRef Name,
llvm::Type* Ty)
llvm::Constant* getOrInsertGlobal(
llvm::StringRef Name,
llvm::Type* Ty)
Description
Look up the specified global in the module symbol table. If required, this overload constructs the global variable using its constructor's defaults.
Declared at: llvm/include/llvm/IR/Module.h:424
Parameters
- llvm::StringRef Name
- llvm::Type* Ty
¶llvm::NamedMDNode*
getOrInsertModuleFlagsMetadata()
llvm::NamedMDNode*
getOrInsertModuleFlagsMetadata()
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:486
¶llvm::NamedMDNode* getOrInsertNamedMetadata(
llvm::StringRef Name)
llvm::NamedMDNode* getOrInsertNamedMetadata(
llvm::StringRef Name)
Description
Return the named MDNode in the module with the specified name. This method returns a new NamedMDNode if a NamedMDNode with the specified name is not found.
Declared at: llvm/include/llvm/IR/Module.h:455
Parameters
- llvm::StringRef Name
¶PICLevel::Level getPICLevel() const
PICLevel::Level getPICLevel() const
Description
Returns the PIC level (small or large model)
Declared at: llvm/include/llvm/IR/Module.h:810
¶PIELevel::Level getPIELevel() const
PIELevel::Level getPIELevel() const
Description
Returns the PIE level (small or large model)
Declared at: llvm/include/llvm/IR/Module.h:821
¶llvm::Metadata* getProfileSummary(bool IsCS)
llvm::Metadata* getProfileSummary(bool IsCS)
Description
Returns profile summary metadata. When IsCS is true, use the context sensitive profile summary.
Declared at: llvm/include/llvm/IR/Module.h:846
Parameters
- bool IsCS
¶bool getRtLibUseGOT() const
bool getRtLibUseGOT() const
Description
Returns true if PLT should be avoided for RTLib calls.
Declared at: llvm/include/llvm/IR/Module.h:850
¶llvm::VersionTuple getSDKVersion() const
llvm::VersionTuple getSDKVersion() const
Description
Get the build SDK version metadata. An empty version is returned if no such metadata is attached.
Declared at: llvm/include/llvm/IR/Module.h:864
¶const std::string& getSourceFileName() const
const std::string& getSourceFileName() const
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:222
¶static int llvm::Module::*getSublistAccess(
llvm::NamedMDNode*)
static int llvm::Module::*getSublistAccess(
llvm::NamedMDNode*)
Declared at: llvm/include/llvm/IR/Module.h:564
Parameters
¶static llvm::Module::FunctionListType
llvm::Module::*
getSublistAccess(llvm::Function*)
static llvm::Module::FunctionListType
llvm::Module::*
getSublistAccess(llvm::Function*)
Declared at: llvm/include/llvm/IR/Module.h:537
Parameters
¶static llvm::Module::AliasListType llvm::Module::*
getSublistAccess(llvm::GlobalAlias*)
static llvm::Module::AliasListType llvm::Module::*
getSublistAccess(llvm::GlobalAlias*)
Declared at: llvm/include/llvm/IR/Module.h:546
Parameters
¶static llvm::Module::IFuncListType llvm::Module::*
getSublistAccess(llvm::GlobalIFunc*)
static llvm::Module::IFuncListType llvm::Module::*
getSublistAccess(llvm::GlobalIFunc*)
Declared at: llvm/include/llvm/IR/Module.h:555
Parameters
¶static llvm::Module::GlobalListType
llvm::Module::*
getSublistAccess(llvm::GlobalVariable*)
static llvm::Module::GlobalListType
llvm::Module::*
getSublistAccess(llvm::GlobalVariable*)
Declared at: llvm/include/llvm/IR/Module.h:529
Parameters
¶const std::string& getTargetTriple() const
const std::string& getTargetTriple() const
Description
Get the target triple which is a string describing the target host.
Declared at: llvm/include/llvm/IR/Module.h:241
Returns
a string containing the target triple.
¶llvm::StructType* getTypeByName(
llvm::StringRef Name) const
llvm::StructType* getTypeByName(
llvm::StringRef Name) const
Description
Return the type with the specified name, or null if there is none by that name.
Declared at: llvm/include/llvm/IR/Module.h:326
Parameters
- llvm::StringRef Name
¶const llvm::ValueSymbolTable&
getValueSymbolTable() const
const llvm::ValueSymbolTable&
getValueSymbolTable() const
Description
Get the symbol table of global variable and function identifiers
Declared at: llvm/include/llvm/IR/Module.h:569
¶llvm::ValueSymbolTable& getValueSymbolTable()
llvm::ValueSymbolTable& getValueSymbolTable()
Description
Get the Module's symbol table of global variable and function identifiers.
Declared at: llvm/include/llvm/IR/Module.h:571
¶int global_begin()
int global_begin()
Declared at: llvm/include/llvm/IR/Module.h:582
¶int global_begin() const
int global_begin() const
Declared at: llvm/include/llvm/IR/Module.h:583
¶bool global_empty() const
bool global_empty() const
Declared at: llvm/include/llvm/IR/Module.h:586
¶int global_end()
int global_end()
Declared at: llvm/include/llvm/IR/Module.h:584
¶int global_end() const
int global_end() const
Declared at: llvm/include/llvm/IR/Module.h:585
¶int global_objects() const
int global_objects() const
Declared at: llvm/include/llvm/IR/Module.h:664
¶int global_objects()
int global_objects()
Declared at: llvm/include/llvm/IR/Module.h:663
¶int global_values() const
int global_values() const
Declared at: llvm/include/llvm/IR/Module.h:674
¶int global_values()
int global_values()
Declared at: llvm/include/llvm/IR/Module.h:673
¶int globals() const
int globals() const
Declared at: llvm/include/llvm/IR/Module.h:591
¶int globals()
int globals()
Declared at: llvm/include/llvm/IR/Module.h:588
¶int ifunc_begin()
int ifunc_begin()
Declared at: llvm/include/llvm/IR/Module.h:639
¶int ifunc_begin() const
int ifunc_begin() const
Declared at: llvm/include/llvm/IR/Module.h:640
¶bool ifunc_empty() const
bool ifunc_empty() const
Declared at: llvm/include/llvm/IR/Module.h:644
¶int ifunc_end() const
int ifunc_end() const
Declared at: llvm/include/llvm/IR/Module.h:642
¶int ifunc_end()
int ifunc_end()
Declared at: llvm/include/llvm/IR/Module.h:641
¶size_t ifunc_size() const
size_t ifunc_size() const
Declared at: llvm/include/llvm/IR/Module.h:643
¶int ifuncs() const
int ifuncs() const
Declared at: llvm/include/llvm/IR/Module.h:649
¶int ifuncs()
int ifuncs()
Declared at: llvm/include/llvm/IR/Module.h:646
¶bool isMaterialized() const
bool isMaterialized() const
Declared at: llvm/include/llvm/IR/Module.h:509
¶static bool isValidModFlagBehavior(
llvm::Metadata* MD,
llvm::Module::ModFlagBehavior& MFB)
static bool isValidModFlagBehavior(
llvm::Metadata* MD,
llvm::Module::ModFlagBehavior& MFB)
Description
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Declared at: llvm/include/llvm/IR/Module.h:155
Parameters
- llvm::Metadata* MD
- llvm::Module::ModFlagBehavior& MFB
¶llvm::Error materialize(llvm::GlobalValue* GV)
llvm::Error materialize(llvm::GlobalValue* GV)
Description
Make sure the GlobalValue is fully read.
Declared at: llvm/include/llvm/IR/Module.h:512
Parameters
¶llvm::Error materializeAll()
llvm::Error materializeAll()
Description
Make sure all GlobalValues in this Module are fully read and clear the Materializer.
Declared at: llvm/include/llvm/IR/Module.h:516
¶llvm::Error materializeMetadata()
llvm::Error materializeMetadata()
Declared at: llvm/include/llvm/IR/Module.h:518
¶int named_metadata() const
int named_metadata() const
Declared at: llvm/include/llvm/IR/Module.h:696
¶int named_metadata()
int named_metadata()
Declared at: llvm/include/llvm/IR/Module.h:693
¶int named_metadata_begin() const
int named_metadata_begin() const
Declared at: llvm/include/llvm/IR/Module.h:681
¶int named_metadata_begin()
int named_metadata_begin()
Declared at: llvm/include/llvm/IR/Module.h:680
¶bool named_metadata_empty() const
bool named_metadata_empty() const
Declared at: llvm/include/llvm/IR/Module.h:691
¶int named_metadata_end() const
int named_metadata_end() const
Declared at: llvm/include/llvm/IR/Module.h:686
¶int named_metadata_end()
int named_metadata_end()
Declared at: llvm/include/llvm/IR/Module.h:685
¶size_t named_metadata_size() const
size_t named_metadata_size() const
Declared at: llvm/include/llvm/IR/Module.h:690
¶void print(
llvm::raw_ostream& OS,
llvm::AssemblyAnnotationWriter* AAW,
bool ShouldPreserveUseListOrder = false,
bool IsForDebug = false) const
void print(
llvm::raw_ostream& OS,
llvm::AssemblyAnnotationWriter* AAW,
bool ShouldPreserveUseListOrder = false,
bool IsForDebug = false) const
Description
Print the module to an output stream with an optional AssemblyAnnotationWriter. If \c ShouldPreserveUseListOrder, then include uselistorder directives so that use-lists can be recreated when reading the assembly.
Declared at: llvm/include/llvm/IR/Module.h:775
Parameters
- llvm::raw_ostream& OS
- llvm::AssemblyAnnotationWriter* AAW
- bool ShouldPreserveUseListOrder = false
- bool IsForDebug = false
¶int rbegin() const
int rbegin() const
Declared at: llvm/include/llvm/IR/Module.h:604
¶int rbegin()
int rbegin()
Declared at: llvm/include/llvm/IR/Module.h:603
¶int rend() const
int rend() const
Declared at: llvm/include/llvm/IR/Module.h:606
¶int rend()
int rend()
Declared at: llvm/include/llvm/IR/Module.h:605
¶void setCodeModel(CodeModel::Model CL)
void setCodeModel(CodeModel::Model CL)
Description
Set the code model (tiny, small, kernel, medium or large)
Declared at: llvm/include/llvm/IR/Module.h:835
Parameters
- CodeModel::Model CL
¶void setDataLayout(llvm::StringRef Desc)
void setDataLayout(llvm::StringRef Desc)
Description
Set the data layout
Declared at: llvm/include/llvm/IR/Module.h:280
Parameters
- llvm::StringRef Desc
¶void setDataLayout(const llvm::DataLayout& Other)
void setDataLayout(const llvm::DataLayout& Other)
Declared at: llvm/include/llvm/IR/Module.h:281
Parameters
- const llvm::DataLayout& Other
¶void setMaterializer(llvm::GVMaterializer* GVM)
void setMaterializer(llvm::GVMaterializer* GVM)
Description
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.
Declared at: llvm/include/llvm/IR/Module.h:506
Parameters
- llvm::GVMaterializer* GVM
¶void setModuleIdentifier(llvm::StringRef ID)
void setModuleIdentifier(llvm::StringRef ID)
Description
Set the module identifier.
Declared at: llvm/include/llvm/IR/Module.h:274
Parameters
¶void setModuleInlineAsm(llvm::StringRef Asm)
void setModuleInlineAsm(llvm::StringRef Asm)
Description
Set the module-scope inline assembly blocks. A trailing newline is added if the input doesn't have one.
Declared at: llvm/include/llvm/IR/Module.h:288
Parameters
- llvm::StringRef Asm
¶void setOwnedMemoryBuffer(int MB)
void setOwnedMemoryBuffer(int MB)
Declared at: llvm/include/llvm/IR/Module.h:868
Parameters
- int MB
¶void setPICLevel(PICLevel::Level PL)
void setPICLevel(PICLevel::Level PL)
Description
Set the PIC level (small or large model)
Declared at: llvm/include/llvm/IR/Module.h:813
Parameters
- PICLevel::Level PL
¶void setPIELevel(PIELevel::Level PL)
void setPIELevel(PIELevel::Level PL)
Description
Set the PIE level (small or large model)
Declared at: llvm/include/llvm/IR/Module.h:824
Parameters
- PIELevel::Level PL
¶void setProfileSummary(llvm::Metadata* M,
ProfileSummary::Kind Kind)
void setProfileSummary(llvm::Metadata* M,
ProfileSummary::Kind Kind)
Description
Attach profile summary metadata to this module.
Declared at: llvm/include/llvm/IR/Module.h:842
Parameters
- llvm::Metadata* M
- ProfileSummary::Kind Kind
¶void setRtLibUseGOT()
void setRtLibUseGOT()
Description
Set that PLT should be avoid for RTLib calls.
Declared at: llvm/include/llvm/IR/Module.h:853
¶void setSDKVersion(const llvm::VersionTuple& V)
void setSDKVersion(const llvm::VersionTuple& V)
Description
Attach a build SDK version metadata to this module.
Declared at: llvm/include/llvm/IR/Module.h:859
Parameters
- const llvm::VersionTuple& V
¶void setSourceFileName(llvm::StringRef Name)
void setSourceFileName(llvm::StringRef Name)
Description
Set the module's original source file name.
Declared at: llvm/include/llvm/IR/Module.h:277
Parameters
- llvm::StringRef Name
¶void setTargetTriple(llvm::StringRef T)
void setTargetTriple(llvm::StringRef T)
Description
Set the target triple.
Declared at: llvm/include/llvm/IR/Module.h:284
Parameters
¶bool shouldEmitInstrCountChangedRemark()
bool shouldEmitInstrCountChangedRemark()
Description
Return true if size-info optimization remark is enabled, false otherwise.
Declared at: llvm/include/llvm/IR/Module.h:264
¶size_t size() const
size_t size() const
Declared at: llvm/include/llvm/IR/Module.h:607
¶~Module()
~Module()
Description
The module destructor. This will dropAllReferences.
Declared at: llvm/include/llvm/IR/Module.h:203