class Module

Declaration

class Module { /* full declaration omitted */ };

Description

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.

Declared at: llvm/include/llvm/IR/Module.h:65

Member Variables

private llvm::LLVMContext& Context
The LLVMContext from which types and constants are allocated.
private llvm::Module::GlobalListType GlobalList
The Global Variables in the module
private llvm::Module::FunctionListType FunctionList
The Functions in the module
private llvm::Module::AliasListType AliasList
The Aliases in the module
private llvm::Module::IFuncListType IFuncList
The IFuncs in the module
private llvm::Module::NamedMDListType NamedMDList
The named metadata in the module
private std::string GlobalScopeAsm
Inline Asm at global scope.
private std::unique_ptr<ValueSymbolTable> ValSymTab
Symbol table for values
private llvm::Module::ComdatSymTabType ComdatSymTab
Symbol table for COMDATs
private std::unique_ptr<MemoryBuffer> OwnedMemoryBuffer
Memory buffer directly owned by this module, for legacy clients only.
private std::unique_ptr<GVMaterializer> Materializer
Used to materialize GlobalValues
private std::string ModuleID
Human readable identifier for the module
private std::string SourceFileName
Original source file name for module, recorded in bitcode.
private std::string TargetTriple
Platform target triple Module compiled on Format: (arch)(sub)-(vendor)-(sys0-(abi)
private llvm::Module::NamedMDSymTabType NamedMDSymTab
NamedMDNode names.
private llvm::DataLayout DL
DataLayout associated with the module
private StringMap<unsigned int> CurrentIntrinsicIds
Keep track of the current unique id count for the specified intrinsic basename.
private DenseMap< std::pair<Intrinsic::ID, const FunctionType*>, unsigned int> UniquedIntrinsicNames
Keep track of uniqued names of intrinsics based on unnamed types. The combination of ID and FunctionType maps to the extension that is used to make the intrinsic name unique.

Method Overview

Methods

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:218

Parameters

llvm::StringRef ModuleID
llvm::LLVMContext& C

void addModuleFlag(llvm::MDNode* Node)

Declared at: llvm/include/llvm/IR/Module.h:516

Parameters

llvm::MDNode* Node

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:513

Parameters

llvm::Module::ModFlagBehavior Behavior
llvm::StringRef Key
llvm::Metadata* Val

void addModuleFlag(
    llvm::Module::ModFlagBehavior Behavior,
    llvm::StringRef Key,
    llvm::Constant* Val)

Declared at: llvm/include/llvm/IR/Module.h:514

Parameters

llvm::Module::ModFlagBehavior Behavior
llvm::StringRef Key
llvm::Constant* Val

void addModuleFlag(
    llvm::Module::ModFlagBehavior Behavior,
    llvm::StringRef Key,
    uint32_t Val)

Declared at: llvm/include/llvm/IR/Module.h:515

Parameters

llvm::Module::ModFlagBehavior Behavior
llvm::StringRef Key
uint32_t Val

llvm::Module::const_alias_iterator alias_begin()
    const

Declared at: llvm/include/llvm/IR/Module.h:648

llvm::Module::alias_iterator alias_begin()

Description

@ } @ {

Declared at: llvm/include/llvm/IR/Module.h:647

bool alias_empty() const

Declared at: llvm/include/llvm/IR/Module.h:652

llvm::Module::const_alias_iterator alias_end()
    const

Declared at: llvm/include/llvm/IR/Module.h:650

llvm::Module::alias_iterator alias_end()

Declared at: llvm/include/llvm/IR/Module.h:649

size_t alias_size() const

Declared at: llvm/include/llvm/IR/Module.h:651

iterator_range<llvm::Module::alias_iterator>
aliases()

Declared at: llvm/include/llvm/IR/Module.h:654

iterator_range<llvm::Module::const_alias_iterator>
aliases() const

Declared at: llvm/include/llvm/IR/Module.h:657

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:313

Parameters

llvm::StringRef Asm

llvm::Module::iterator begin()

Description

@ } @ {

Declared at: llvm/include/llvm/IR/Module.h:625

llvm::Module::const_iterator begin() const

Declared at: llvm/include/llvm/IR/Module.h:626

std::unique_ptr<RandomNumberGenerator> createRNG(
    const llvm::StringRef Name) const

Description

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.

Declared at: llvm/include/llvm/IR/Module.h:277

Parameters

const llvm::StringRef Name

iterator_range<
    llvm::Module::debug_compile_units_iterator>
debug_compile_units() const

Description

Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and aren't explicitly marked as NoDebug.

Declared at: llvm/include/llvm/IR/Module.h:782

llvm::Module::debug_compile_units_iterator
debug_compile_units_begin() const

Declared at: llvm/include/llvm/IR/Module.h:769

llvm::Module::debug_compile_units_iterator
debug_compile_units_end() const

Declared at: llvm/include/llvm/IR/Module.h:774

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:819

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:797

void dump() const

Description

Dump the module to stderr (for debugging).

Declared at: llvm/include/llvm/IR/Module.h:811

bool empty() const

Declared at: llvm/include/llvm/IR/Module.h:634

llvm::Module::const_iterator end() const

Declared at: llvm/include/llvm/IR/Module.h:628

llvm::Module::iterator end()

Declared at: llvm/include/llvm/IR/Module.h:627

void eraseNamedMetadata(llvm::NamedMDNode* NMD)

Description

Remove the given NamedMDNode from this module and delete it.

Declared at: llvm/include/llvm/IR/Module.h:481

Parameters

llvm::NamedMDNode* NMD

iterator_range<llvm::Module::const_iterator>
functions() const

Declared at: llvm/include/llvm/IR/Module.h:639

iterator_range<llvm::Module::iterator> functions()

Declared at: llvm/include/llvm/IR/Module.h:636

const llvm::Module::AliasListType& getAliasList()
    const

Description

Get the Module's list of aliases (constant).

Declared at: llvm/include/llvm/IR/Module.h:567

llvm::Module::AliasListType& getAliasList()

Description

Get the Module's list of aliases.

Declared at: llvm/include/llvm/IR/Module.h:569

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:866

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:837

const llvm::Module::ComdatSymTabType&
getComdatSymbolTable() const

Description

Get the Module's symbol table for COMDATs (constant).

Declared at: llvm/include/llvm/IR/Module.h:599

llvm::Module::ComdatSymTabType&
getComdatSymbolTable()

Description

Get the Module's symbol table for COMDATs.

Declared at: llvm/include/llvm/IR/Module.h:601

llvm::LLVMContext& getContext() const

Description

Get the global data context.

Declared at: llvm/include/llvm/IR/Module.h:262

Returns

LLVMContext - a container for LLVM's global information

llvm::VersionTuple
getDarwinTargetVariantSDKVersion() const

Description

Get the target variant version build SDK version metadata. An empty version is returned if no such metadata is attached.

Declared at: llvm/include/llvm/IR/Module.h:958

llvm::StringRef getDarwinTargetVariantTriple()
    const

Description

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.

Declared at: llvm/include/llvm/IR/Module.h:949

Returns

a string containing the target variant triple.

const llvm::DataLayout& getDataLayout() const

Description

Get the data layout for the module's target platform.

Declared at: llvm/include/llvm/IR/Module.h:254

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:249

unsigned int getDwarfVersion() const

Description

Returns the Dwarf Version by checking module flags.

Declared at: llvm/include/llvm/IR/Module.h:830

llvm::FramePointerKind getFramePointer() const

Description

Get/set whether synthesized functions should get the "frame-pointer" attribute.

Declared at: llvm/include/llvm/IR/Module.h:901

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:404

Parameters

llvm::StringRef Name

const llvm::Module::FunctionListType&
getFunctionList() const

Description

Get the Module's list of functions (constant).

Declared at: llvm/include/llvm/IR/Module.h:559

llvm::Module::FunctionListType& getFunctionList()

Description

Get the Module's list of functions.

Declared at: llvm/include/llvm/IR/Module.h:561

llvm::Module::GlobalListType& getGlobalList()

Description

Get the Module's list of global variables.

Declared at: llvm/include/llvm/IR/Module.h:552

const llvm::Module::GlobalListType&
getGlobalList() const

Description

Get the Module's list of global variables (constant).

Declared at: llvm/include/llvm/IR/Module.h:550

llvm::GlobalVariable* getGlobalVariable(
    llvm::StringRef Name,
    bool AllowInternal = false)

Declared at: llvm/include/llvm/IR/Module.h:420

Parameters

llvm::StringRef Name
bool AllowInternal = false

llvm::GlobalVariable* getGlobalVariable(
    llvm::StringRef Name,
    bool AllowInternal) const

Declared at: llvm/include/llvm/IR/Module.h:418

Parameters

llvm::StringRef Name
bool AllowInternal

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:414

Parameters

llvm::StringRef Name

const llvm::Module::IFuncListType& getIFuncList()
    const

Description

Get the Module's list of ifuncs (constant).

Declared at: llvm/include/llvm/IR/Module.h:576

llvm::Module::IFuncListType& getIFuncList()

Description

Get the Module's list of ifuncs.

Declared at: llvm/include/llvm/IR/Module.h:578

std::vector<StructType*>
getIdentifiedStructTypes() const

Declared at: llvm/include/llvm/IR/Module.h:344

unsigned int getInstructionCount() const

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:233

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:333

Parameters

llvm::StringRef Name

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:337

Parameters

SmallVectorImpl<llvm::StringRef>& Result

llvm::GVMaterializer* getMaterializer() const

Description

Retrieves the GVMaterializer, if any, for this Module.

Declared at: llvm/include/llvm/IR/Module.h:533

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:500

Parameters

llvm::StringRef Key

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:496

Parameters

SmallVectorImpl<llvm::Module::ModuleFlagEntry>& Flags

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:504

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:228

Returns

the module identifier as a string

const std::string& getModuleInlineAsm() const

Description

Get any module-scope inline assembly blocks.

Declared at: llvm/include/llvm/IR/Module.h:266

Returns

a string containing the module-scope inline assembly blocks.

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:245

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:456

Parameters

llvm::StringRef Name

llvm::GlobalVariable* getNamedGlobal(
    llvm::StringRef Name)

Declared at: llvm/include/llvm/IR/Module.h:432

Parameters

llvm::StringRef Name

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:429

Parameters

llvm::StringRef Name

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:465

Parameters

llvm::StringRef Name

const llvm::Module::NamedMDListType&
getNamedMDList() const

Description

Get the Module's list of named metadata (constant).

Declared at: llvm/include/llvm/IR/Module.h:585

llvm::Module::NamedMDListType& getNamedMDList()

Description

Get the Module's list of named metadata.

Declared at: llvm/include/llvm/IR/Module.h:587

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:473

Parameters

const llvm::Twine& Name

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:326

Parameters

llvm::StringRef Name

unsigned int getNumNamedValues() const

Description

Return the number of global values in the module.

Declared at: llvm/include/llvm/IR/Module.h:329

unsigned int getNumberRegisterParameters() const

Description

Returns the Number of Register ParametersDwarf Version by checking module flags.

Declared at: llvm/include/llvm/IR/Module.h:827

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:342

Parameters

SmallVectorImpl<llvm::StringRef>& Result

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:489

Parameters

llvm::StringRef Name

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:399

Templates

ArgsTy

Parameters

llvm::StringRef Name
llvm::AttributeList AttributeList
llvm::FunctionType* Invalid
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:380

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)

Description

Same as above, but without the attributes.

Declared at: llvm/include/llvm/IR/Module.h:391

Templates

ArgsTy

Parameters

llvm::StringRef Name
llvm::Type* RetTy
ArgsTy... Args

llvm::FunctionCallee getOrInsertFunction(
    llvm::StringRef Name,
    llvm::FunctionType* T)

Declared at: llvm/include/llvm/IR/Module.h:371

Parameters

llvm::StringRef Name
llvm::FunctionType* T

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. Note: For library calls getOrInsertLibFunc() should be used instead.

Declared at: llvm/include/llvm/IR/Module.h:368

Parameters

llvm::StringRef Name
llvm::FunctionType* T
llvm::AttributeList AttributeList

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:447

Parameters

llvm::StringRef Name
llvm::Type* Ty

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:442

Parameters

llvm::StringRef Name
llvm::Type* Ty
function_ref<llvm::GlobalVariable*()> CreateGlobalCallback

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:509

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:478

Parameters

llvm::StringRef Name

unsigned int getOverrideStackAlignment() const

Description

Get/set the stack alignment overridden from the default.

Declared at: llvm/include/llvm/IR/Module.h:923

PICLevel::Level getPICLevel() const

Description

Returns the PIC level (small or large model)

Declared at: llvm/include/llvm/IR/Module.h:844

PIELevel::Level getPIELevel() const

Description

Returns the PIE level (small or large model)

Declared at: llvm/include/llvm/IR/Module.h:855

llvm::Metadata* getProfileSummary(bool IsCS) const

Description

Returns profile summary metadata. When IsCS is true, use the context sensitive profile summary.

Declared at: llvm/include/llvm/IR/Module.h:880

Parameters

bool IsCS

bool getRtLibUseGOT() const

Description

Returns true if PLT should be avoided for RTLib calls.

Declared at: llvm/include/llvm/IR/Module.h:890

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:935

bool getSemanticInterposition() const

Description

Returns whether semantic interposition is to be respected.

Declared at: llvm/include/llvm/IR/Module.h:884

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:239

llvm::StringRef getStackProtectorGuard() const

Description

Get/set what kind of stack protector guard to use.

Declared at: llvm/include/llvm/IR/Module.h:905

int getStackProtectorGuardOffset() const

Description

Get/set what offset from the stack protector to use.

Declared at: llvm/include/llvm/IR/Module.h:919

llvm::StringRef getStackProtectorGuardReg() const

Description

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".

Declared at: llvm/include/llvm/IR/Module.h:911

llvm::StringRef getStackProtectorGuardSymbol()
    const

Description

Get/set a symbol to use as the stack protector guard.

Declared at: llvm/include/llvm/IR/Module.h:915

static llvm::Module::AliasListType llvm::Module::*
getSublistAccess(llvm::GlobalAlias*)

Declared at: llvm/include/llvm/IR/Module.h:571

Parameters

llvm::GlobalAlias*

static llvm::Module::IFuncListType llvm::Module::*
getSublistAccess(llvm::GlobalIFunc*)

Declared at: llvm/include/llvm/IR/Module.h:580

Parameters

llvm::GlobalIFunc*

static llvm::Module::FunctionListType
    llvm::Module::*
    getSublistAccess(llvm::Function*)

Declared at: llvm/include/llvm/IR/Module.h:562

Parameters

llvm::Function*

static llvm::Module::GlobalListType
    llvm::Module::*
    getSublistAccess(llvm::GlobalVariable*)

Declared at: llvm/include/llvm/IR/Module.h:554

Parameters

llvm::GlobalVariable*

static llvm::Module::NamedMDListType
    llvm::Module::*
    getSublistAccess(llvm::NamedMDNode*)

Declared at: llvm/include/llvm/IR/Module.h:589

Parameters

llvm::NamedMDNode*

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:258

Returns

a string containing the target triple.

std::string getUniqueIntrinsicName(
    llvm::StringRef BaseName,
    Intrinsic::ID Id,
    const llvm::FunctionType* Proto)

Description

Return a unique name for an intrinsic whose mangling is based on an unnamed type. The Proto represents the function prototype.

Declared at: llvm/include/llvm/IR/Module.h:348

Parameters

llvm::StringRef BaseName
Intrinsic::ID Id
const llvm::FunctionType* Proto

llvm::UWTableKind getUwtable() const

Description

Get/set whether synthesized functions should get the uwtable attribute.

Declared at: llvm/include/llvm/IR/Module.h:896

llvm::ValueSymbolTable& getValueSymbolTable()

Description

Get the Module's symbol table of global variable and function identifiers.

Declared at: llvm/include/llvm/IR/Module.h:596

const llvm::ValueSymbolTable&
getValueSymbolTable() const

Description

Get the symbol table of global variable and function identifiers

Declared at: llvm/include/llvm/IR/Module.h:594

llvm::Module::global_iterator global_begin()

Description

@ } @ {

Declared at: llvm/include/llvm/IR/Module.h:607

llvm::Module::const_global_iterator global_begin()
    const

Declared at: llvm/include/llvm/IR/Module.h:608

bool global_empty() const

Declared at: llvm/include/llvm/IR/Module.h:612

llvm::Module::global_iterator global_end()

Declared at: llvm/include/llvm/IR/Module.h:609

llvm::Module::const_global_iterator global_end()
    const

Declared at: llvm/include/llvm/IR/Module.h:610

iterator_range<
    llvm::Module::const_global_object_iterator>
global_objects() const

Declared at: llvm/include/llvm/IR/Module.h:690

iterator_range<
    llvm::Module::global_object_iterator>
global_objects()

Declared at: llvm/include/llvm/IR/Module.h:689

size_t global_size() const

Declared at: llvm/include/llvm/IR/Module.h:611

iterator_range<
    llvm::Module::global_value_iterator>
global_values()

Declared at: llvm/include/llvm/IR/Module.h:699

iterator_range<
    llvm::Module::const_global_value_iterator>
global_values() const

Declared at: llvm/include/llvm/IR/Module.h:700

iterator_range<
    llvm::Module::const_global_iterator>
globals() const

Declared at: llvm/include/llvm/IR/Module.h:617

iterator_range<llvm::Module::global_iterator>
globals()

Declared at: llvm/include/llvm/IR/Module.h:614

llvm::Module::const_ifunc_iterator ifunc_begin()
    const

Declared at: llvm/include/llvm/IR/Module.h:666

llvm::Module::ifunc_iterator ifunc_begin()

Description

@ } @ {

Declared at: llvm/include/llvm/IR/Module.h:665

bool ifunc_empty() const

Declared at: llvm/include/llvm/IR/Module.h:670

llvm::Module::const_ifunc_iterator ifunc_end()
    const

Declared at: llvm/include/llvm/IR/Module.h:668

llvm::Module::ifunc_iterator ifunc_end()

Declared at: llvm/include/llvm/IR/Module.h:667

size_t ifunc_size() const

Declared at: llvm/include/llvm/IR/Module.h:669

iterator_range<llvm::Module::ifunc_iterator>
ifuncs()

Declared at: llvm/include/llvm/IR/Module.h:672

iterator_range<llvm::Module::const_ifunc_iterator>
ifuncs() const

Declared at: llvm/include/llvm/IR/Module.h:675

bool isDwarf64() const

Description

Returns the DWARF format by checking module flags.

Declared at: llvm/include/llvm/IR/Module.h:833

bool isMaterialized() const

Declared at: llvm/include/llvm/IR/Module.h:534

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:159

Parameters

llvm::Metadata* MD
llvm::Module::ModFlagBehavior& MFB

static bool isValidModuleFlag(
    const llvm::MDNode& ModFlag,
    llvm::Module::ModFlagBehavior& MFB,
    llvm::MDString*& Key,
    llvm::Metadata*& Val)

Description

Check if the given module flag metadata represents a valid module flag, and store the flag behavior, the key string and the value metadata.

Declared at: llvm/include/llvm/IR/Module.h:163

Parameters

const llvm::MDNode& ModFlag
llvm::Module::ModFlagBehavior& MFB
llvm::MDString*& Key
llvm::Metadata*& Val

llvm::Error materialize(llvm::GlobalValue* GV)

Description

Make sure the GlobalValue is fully read.

Declared at: llvm/include/llvm/IR/Module.h:537

Parameters

llvm::GlobalValue* GV

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:541

llvm::Error materializeMetadata()

Declared at: llvm/include/llvm/IR/Module.h:543

iterator_range<
    llvm::Module::named_metadata_iterator>
named_metadata()

Declared at: llvm/include/llvm/IR/Module.h:719

iterator_range<
    llvm::Module::const_named_metadata_iterator>
named_metadata() const

Declared at: llvm/include/llvm/IR/Module.h:722

llvm::Module::named_metadata_iterator
named_metadata_begin()

Description

@ } @ {

Declared at: llvm/include/llvm/IR/Module.h:706

llvm::Module::const_named_metadata_iterator
named_metadata_begin() const

Declared at: llvm/include/llvm/IR/Module.h:707

bool named_metadata_empty() const

Declared at: llvm/include/llvm/IR/Module.h:717

llvm::Module::const_named_metadata_iterator
named_metadata_end() const

Declared at: llvm/include/llvm/IR/Module.h:712

llvm::Module::named_metadata_iterator
named_metadata_end()

Declared at: llvm/include/llvm/IR/Module.h:711

size_t named_metadata_size() const

Declared at: llvm/include/llvm/IR/Module.h:716

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:806

Parameters

llvm::raw_ostream& OS
llvm::AssemblyAnnotationWriter* AAW
bool ShouldPreserveUseListOrder = false
bool IsForDebug = false

llvm::Module::reverse_iterator rbegin()

Declared at: llvm/include/llvm/IR/Module.h:629

llvm::Module::const_reverse_iterator rbegin()
    const

Declared at: llvm/include/llvm/IR/Module.h:630

llvm::Module::reverse_iterator rend()

Declared at: llvm/include/llvm/IR/Module.h:631

llvm::Module::const_reverse_iterator rend() const

Declared at: llvm/include/llvm/IR/Module.h:632

void setCodeModel(CodeModel::Model CL)

Description

Set the code model (tiny, small, kernel, medium or large)

Declared at: llvm/include/llvm/IR/Module.h:869

Parameters

CodeModel::Model CL

void setDarwinTargetVariantSDKVersion(
    llvm::VersionTuple Version)

Description

Set the target variant version build SDK version metadata.

Declared at: llvm/include/llvm/IR/Module.h:961

Parameters

llvm::VersionTuple Version

void setDarwinTargetVariantTriple(
    llvm::StringRef T)

Description

Set the target variant triple which is a string describing a variant of the target host platform.

Declared at: llvm/include/llvm/IR/Module.h:953

Parameters

llvm::StringRef T

void setDataLayout(const llvm::DataLayout& Other)

Declared at: llvm/include/llvm/IR/Module.h:298

Parameters

const llvm::DataLayout& Other

void setDataLayout(llvm::StringRef Desc)

Description

Set the data layout

Declared at: llvm/include/llvm/IR/Module.h:297

Parameters

llvm::StringRef Desc

void setFramePointer(llvm::FramePointerKind Kind)

Declared at: llvm/include/llvm/IR/Module.h:902

Parameters

llvm::FramePointerKind Kind

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:531

Parameters

llvm::GVMaterializer* GVM

void setModuleFlag(
    llvm::Module::ModFlagBehavior Behavior,
    llvm::StringRef Key,
    llvm::Metadata* Val)

Description

Like addModuleFlag but replaces the old module flag if it already exists.

Declared at: llvm/include/llvm/IR/Module.h:518

Parameters

llvm::Module::ModFlagBehavior Behavior
llvm::StringRef Key
llvm::Metadata* Val

void setModuleIdentifier(llvm::StringRef ID)

Description

Set the module identifier.

Declared at: llvm/include/llvm/IR/Module.h:291

Parameters

llvm::StringRef ID

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:305

Parameters

llvm::StringRef Asm

void setOverrideStackAlignment(unsigned int Align)

Declared at: llvm/include/llvm/IR/Module.h:924

Parameters

unsigned int Align

void setOwnedMemoryBuffer(
    std::unique_ptr<MemoryBuffer> MB)

Description

Take ownership of the given memory buffer.

Declared at: llvm/include/llvm/IR/Module.h:939

Parameters

std::unique_ptr<MemoryBuffer> MB

void setPICLevel(PICLevel::Level PL)

Description

Set the PIC level (small or large model)

Declared at: llvm/include/llvm/IR/Module.h:847

Parameters

PICLevel::Level PL

void setPIELevel(PIELevel::Level PL)

Description

Set the PIE level (small or large model)

Declared at: llvm/include/llvm/IR/Module.h:858

Parameters

PIELevel::Level PL

void setPartialSampleProfileRatio(
    const llvm::ModuleSummaryIndex& Index)

Description

Set the partial sample profile ratio in the profile summary module flag, if applicable.

Declared at: llvm/include/llvm/IR/Module.h:943

Parameters

const llvm::ModuleSummaryIndex& Index

void setProfileSummary(llvm::Metadata* M,
                       ProfileSummary::Kind Kind)

Description

Attach profile summary metadata to this module.

Declared at: llvm/include/llvm/IR/Module.h:876

Parameters

llvm::Metadata* M
ProfileSummary::Kind Kind

void setRtLibUseGOT()

Description

Set that PLT should be avoid for RTLib calls.

Declared at: llvm/include/llvm/IR/Module.h:893

void setSDKVersion(const llvm::VersionTuple& V)

Description

Attach a build SDK version metadata to this module.

Declared at: llvm/include/llvm/IR/Module.h:930

Parameters

const llvm::VersionTuple& V

void setSemanticInterposition(bool)

Description

Set whether semantic interposition is to be respected.

Declared at: llvm/include/llvm/IR/Module.h:887

Parameters

bool

void setSourceFileName(llvm::StringRef Name)

Description

Set the module's original source file name.

Declared at: llvm/include/llvm/IR/Module.h:294

Parameters

llvm::StringRef Name

void setStackProtectorGuard(llvm::StringRef Kind)

Declared at: llvm/include/llvm/IR/Module.h:906

Parameters

llvm::StringRef Kind

void setStackProtectorGuardOffset(int Offset)

Declared at: llvm/include/llvm/IR/Module.h:920

Parameters

int Offset

void setStackProtectorGuardReg(
    llvm::StringRef Reg)

Declared at: llvm/include/llvm/IR/Module.h:912

Parameters

llvm::StringRef Reg

void setStackProtectorGuardSymbol(
    llvm::StringRef Symbol)

Declared at: llvm/include/llvm/IR/Module.h:916

Parameters

llvm::StringRef Symbol

void setTargetTriple(llvm::StringRef T)

Description

Set the target triple.

Declared at: llvm/include/llvm/IR/Module.h:301

Parameters

llvm::StringRef T

void setUwtable(llvm::UWTableKind Kind)

Declared at: llvm/include/llvm/IR/Module.h:897

Parameters

llvm::UWTableKind Kind

bool shouldEmitInstrCountChangedRemark()

Description

Return true if size-info optimization remark is enabled, false otherwise.

Declared at: llvm/include/llvm/IR/Module.h:281

size_t size() const

Declared at: llvm/include/llvm/IR/Module.h:633

~Module()

Description

The module destructor. This will dropAllReferences.

Declared at: llvm/include/llvm/IR/Module.h:220