LLVM  8.0.1
Classes | Public Member Functions | List of all members
llvm::Module Class Reference

A Module instance is used to store all the information related to an LLVM module. More...

#include "llvm/IR/Module.h"

Classes

class  debug_compile_units_iterator
 An iterator for DICompileUnits that skips those marked NoDebug. More...
 
struct  ModuleFlagEntry
 

Public Member Functions

void dropTriviallyDeadConstantArrays ()
 Destroy ConstantArrays in LLVMContext if they are not used. More...
 
bool getRtLibUseGOT () const
 Returns true if PLT should be avoided for RTLib calls. More...
 
void setRtLibUseGOT ()
 Set that PLT should be avoid for RTLib calls. More...
 
void setOwnedMemoryBuffer (std::unique_ptr< MemoryBuffer > MB)
 Take ownership of the given memory buffer. More...
 
Constructors
 Module (StringRef ModuleID, LLVMContext &C)
 The Module constructor. More...
 
 ~Module ()
 The module destructor. This will dropAllReferences. More...
 
Module Level Accessors
const std::string & getModuleIdentifier () const
 Get the module identifier which is, essentially, the name of the module. More...
 
unsigned getInstructionCount ()
 Returns the number of non-debug IR instructions in the module. More...
 
const std::string & getSourceFileName () const
 Get the module's original source file name. More...
 
StringRef getName () const
 Get a short "name" for the module. More...
 
const std::string & getDataLayoutStr () const
 Get the data layout string for the module's target platform. More...
 
const DataLayoutgetDataLayout () const
 Get the data layout for the module's target platform. More...
 
const std::string & getTargetTriple () const
 Get the target triple which is a string describing the target host. More...
 
LLVMContextgetContext () const
 Get the global data context. More...
 
const std::string & getModuleInlineAsm () const
 Get any module-scope inline assembly blocks. More...
 
std::unique_ptr< RandomNumberGeneratorcreateRNG (const Pass *P) const
 Get a RandomNumberGenerator salted for use with this module. More...
 
bool shouldEmitInstrCountChangedRemark ()
 Return true if size-info optimization remark is enabled, false otherwise. More...
 
Module Level Mutators
void setModuleIdentifier (StringRef ID)
 Set the module identifier. More...
 
void setSourceFileName (StringRef Name)
 Set the module's original source file name. More...
 
void setDataLayout (StringRef Desc)
 Set the data layout. More...
 
void setDataLayout (const DataLayout &Other)
 
void setTargetTriple (StringRef T)
 Set the target triple. More...
 
void setModuleInlineAsm (StringRef Asm)
 Set the module-scope inline assembly blocks. More...
 
void appendModuleInlineAsm (StringRef Asm)
 Append to the module-scope inline assembly blocks. More...
 
Generic Value Accessors
GlobalValuegetNamedValue (StringRef Name) const
 Return the global value in the module with the specified name, of arbitrary type. More...
 
unsigned getMDKindID (StringRef Name) const
 Return a unique non-zero ID for the specified metadata kind. More...
 
void getMDKindNames (SmallVectorImpl< StringRef > &Result) const
 Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext. More...
 
void getOperandBundleTags (SmallVectorImpl< StringRef > &Result) const
 Populate client supplied SmallVector with the bundle tags registered in this LLVMContext. More...
 
StructTypegetTypeByName (StringRef Name) const
 Return the type with the specified name, or null if there is none by that name. More...
 
std::vector< StructType * > getIdentifiedStructTypes () const
 
Function Accessors
ConstantgetOrInsertFunction (StringRef Name, FunctionType *T, AttributeList AttributeList)
 Look up the specified function in the module symbol table. More...
 
ConstantgetOrInsertFunction (StringRef Name, FunctionType *T)
 
template<typename... ArgsTy>
ConstantgetOrInsertFunction (StringRef Name, AttributeList AttributeList, Type *RetTy, ArgsTy... Args)
 Look up the specified function in the module symbol table. More...
 
template<typename... ArgsTy>
ConstantgetOrInsertFunction (StringRef Name, Type *RetTy, ArgsTy... Args)
 Same as above, but without the attributes. More...
 
template<typename... ArgsTy>
ConstantgetOrInsertFunction (StringRef Name, AttributeList AttributeList, FunctionType *Invalid, ArgsTy... Args)=delete
 
FunctiongetFunction (StringRef Name) const
 Look up the specified function in the module symbol table. More...
 
Global Variable Accessors
GlobalVariablegetGlobalVariable (StringRef Name) const
 Look up the specified global variable in the module symbol table. More...
 
GlobalVariablegetGlobalVariable (StringRef Name, bool AllowInternal) const
 getGlobalVariable - Look up the specified global variable in the module symbol table. More...
 
GlobalVariablegetGlobalVariable (StringRef Name, bool AllowInternal=false)
 
const GlobalVariablegetNamedGlobal (StringRef Name) const
 Return the global variable in the module with the specified name, of arbitrary type. More...
 
GlobalVariablegetNamedGlobal (StringRef Name)
 
ConstantgetOrInsertGlobal (StringRef Name, Type *Ty, function_ref< GlobalVariable *()> CreateGlobalCallback)
 Look up the specified global in the module symbol table. More...
 
ConstantgetOrInsertGlobal (StringRef Name, Type *Ty)
 Look up the specified global in the module symbol table. More...
 
Global Alias Accessors
GlobalAliasgetNamedAlias (StringRef Name) const
 Return the global alias in the module with the specified name, of arbitrary type. More...
 
Global IFunc Accessors
GlobalIFuncgetNamedIFunc (StringRef Name) const
 Return the global ifunc in the module with the specified name, of arbitrary type. More...
 
Named Metadata Accessors
NamedMDNodegetNamedMetadata (const Twine &Name) const
 Return the first NamedMDNode in the module with the specified name. More...
 
NamedMDNodegetOrInsertNamedMetadata (StringRef Name)
 Return the named MDNode in the module with the specified name. More...
 
void eraseNamedMetadata (NamedMDNode *NMD)
 Remove the given NamedMDNode from this module and delete it. More...
 
Comdat Accessors
ComdatgetOrInsertComdat (StringRef Name)
 Return the Comdat in the module with the specified name. More...
 
Module Flags Accessors
void getModuleFlagsMetadata (SmallVectorImpl< ModuleFlagEntry > &Flags) const
 Returns the module flags in the provided vector. More...
 
MetadatagetModuleFlag (StringRef Key) const
 Return the corresponding value if Key appears in module flags, otherwise return null. More...
 
NamedMDNodegetModuleFlagsMetadata () const
 Returns the NamedMDNode in the module that represents module-level flags. More...
 
NamedMDNodegetOrInsertModuleFlagsMetadata ()
 Returns the NamedMDNode in the module that represents module-level flags. More...
 
void addModuleFlag (ModFlagBehavior Behavior, StringRef Key, Metadata *Val)
 Add a module-level flag to the module-level flags metadata. More...
 
void addModuleFlag (ModFlagBehavior Behavior, StringRef Key, Constant *Val)
 
void addModuleFlag (ModFlagBehavior Behavior, StringRef Key, uint32_t Val)
 
void addModuleFlag (MDNode *Node)
 
Materialization
void setMaterializer (GVMaterializer *GVM)
 Sets the GVMaterializer to GVM. More...
 
GVMaterializergetMaterializer () const
 Retrieves the GVMaterializer, if any, for this Module. More...
 
bool isMaterialized () const
 
llvm::Error materialize (GlobalValue *GV)
 Make sure the GlobalValue is fully read. More...
 
llvm::Error materializeAll ()
 Make sure all GlobalValues in this Module are fully read and clear the Materializer. More...
 
llvm::Error materializeMetadata ()
 
Global Variable Iteration
global_iterator global_begin ()
 
const_global_iterator global_begin () const
 
global_iterator global_end ()
 
const_global_iterator global_end () const
 
bool global_empty () const
 
iterator_range< global_iteratorglobals ()
 
iterator_range< const_global_iteratorglobals () 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< iteratorfunctions ()
 
iterator_range< const_iteratorfunctions () 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_iteratoraliases ()
 
iterator_range< const_alias_iteratoraliases () 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_iteratorifuncs ()
 
iterator_range< const_ifunc_iteratorifuncs () 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_iteratornamed_metadata ()
 
iterator_range< const_named_metadata_iteratornamed_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_iteratordebug_compile_units () const
 Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and aren't explicitly marked as NoDebug. More...
 
Utility functions for printing and dumping Module objects
void print (raw_ostream &OS, AssemblyAnnotationWriter *AAW, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
 Print the module to an output stream with an optional AssemblyAnnotationWriter. More...
 
void dump () const
 Dump the module to stderr (for debugging). More...
 
void dropAllReferences ()
 This function causes all the subinstructions to "let go" of all references that they are maintaining. More...
 
Utility functions for querying Debug information.
unsigned getNumberRegisterParameters () const
 Returns the Number of Register ParametersDwarf Version by checking module flags. More...
 
unsigned getDwarfVersion () const
 Returns the Dwarf Version by checking module flags. More...
 
unsigned getCodeViewFlag () const
 Returns the CodeView Version by checking module flags. More...
 
Utility functions for querying and setting PIC level
PICLevel::Level getPICLevel () const
 Returns the PIC level (small or large model) More...
 
void setPICLevel (PICLevel::Level PL)
 Set the PIC level (small or large model) More...
 
Utility functions for querying and setting PIE level
PIELevel::Level getPIELevel () const
 Returns the PIE level (small or large model) More...
 
void setPIELevel (PIELevel::Level PL)
 Set the PIE level (small or large model) More...
 
Utility function for querying and setting code model
Optional< CodeModel::ModelgetCodeModel () const
 Returns the code model (tiny, small, kernel, medium or large model) More...
 
void setCodeModel (CodeModel::Model CL)
 Set the code model (tiny, small, kernel, medium or large) More...
 
Utility functions for querying and setting PGO summary
void setProfileSummary (Metadata *M)
 Attach profile summary metadata to this module. More...
 
MetadatagetProfileSummary ()
 Returns profile summary metadata. More...
 
Utility functions for querying and setting the build SDK version
void setSDKVersion (const VersionTuple &V)
 Attach a build SDK version metadata to this module. More...
 
VersionTuple getSDKVersion () const
 Get the build SDK version metadata. More...
 

Types And Enumerations

enum  ModFlagBehavior {
  Error = 1, Warning = 2, Require = 3, Override = 4,
  Append = 5, AppendUnique = 6, Max = 7, ModFlagBehaviorFirstVal = Error,
  ModFlagBehaviorLastVal = Max
}
 This enumeration defines the supported behaviors of module flags. More...
 
using GlobalListType = SymbolTableList< GlobalVariable >
 The type for the list of global variables. More...
 
using FunctionListType = SymbolTableList< Function >
 The type for the list of functions. More...
 
using AliasListType = SymbolTableList< GlobalAlias >
 The type for the list of aliases. More...
 
using IFuncListType = SymbolTableList< GlobalIFunc >
 The type for the list of ifuncs. More...
 
using NamedMDListType = ilist< NamedMDNode >
 The type for the list of named metadata. More...
 
using ComdatSymTabType = StringMap< Comdat >
 The type of the comdat "symbol" table. More...
 
using global_iterator = GlobalListType::iterator
 The Global Variable iterator. More...
 
using const_global_iterator = GlobalListType::const_iterator
 The Global Variable constant iterator. More...
 
using iterator = FunctionListType::iterator
 The Function iterators. More...
 
using const_iterator = FunctionListType::const_iterator
 The Function constant iterator. More...
 
using reverse_iterator = FunctionListType::reverse_iterator
 The Function reverse iterator. More...
 
using const_reverse_iterator = FunctionListType::const_reverse_iterator
 The Function constant reverse iterator. More...
 
using alias_iterator = AliasListType::iterator
 The Global Alias iterators. More...
 
using const_alias_iterator = AliasListType::const_iterator
 The Global Alias constant iterator. More...
 
using ifunc_iterator = IFuncListType::iterator
 The Global IFunc iterators. More...
 
using const_ifunc_iterator = IFuncListType::const_iterator
 The Global IFunc constant iterator. More...
 
using named_metadata_iterator = NamedMDListType::iterator
 The named metadata iterators. More...
 
using const_named_metadata_iterator = NamedMDListType::const_iterator
 The named metadata constant iterators. More...
 
static bool isValidModFlagBehavior (Metadata *MD, ModFlagBehavior &MFB)
 Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB. More...
 

Member Variables

class Constant
 

Direct access to the globals list, functions list, and symbol table

static GlobalListType Module::* getSublistAccess (GlobalVariable *)
 
static FunctionListType Module::* getSublistAccess (Function *)
 
static AliasListType Module::* getSublistAccess (GlobalAlias *)
 
static IFuncListType Module::* getSublistAccess (GlobalIFunc *)
 
static NamedMDListType Module::* getSublistAccess (NamedMDNode *)
 
const GlobalListTypegetGlobalList () const
 Get the Module's list of global variables (constant). More...
 
GlobalListTypegetGlobalList ()
 Get the Module's list of global variables. More...
 
const FunctionListTypegetFunctionList () const
 Get the Module's list of functions (constant). More...
 
FunctionListTypegetFunctionList ()
 Get the Module's list of functions. More...
 
const AliasListTypegetAliasList () const
 Get the Module's list of aliases (constant). More...
 
AliasListTypegetAliasList ()
 Get the Module's list of aliases. More...
 
const IFuncListTypegetIFuncList () const
 Get the Module's list of ifuncs (constant). More...
 
IFuncListTypegetIFuncList ()
 Get the Module's list of ifuncs. More...
 
const NamedMDListTypegetNamedMDList () const
 Get the Module's list of named metadata (constant). More...
 
NamedMDListTypegetNamedMDList ()
 Get the Module's list of named metadata. More...
 
const ValueSymbolTablegetValueSymbolTable () const
 Get the symbol table of global variable and function identifiers. More...
 
ValueSymbolTablegetValueSymbolTable ()
 Get the Module's symbol table of global variable and function identifiers. More...
 
const ComdatSymTabTypegetComdatSymbolTable () const
 Get the Module's symbol table for COMDATs (constant). More...
 
ComdatSymTabTypegetComdatSymbolTable ()
 Get the Module's symbol table for COMDATs. More...
 

Convenience iterators

using global_object_iterator = concat_iterator< GlobalObject, iterator, global_iterator >
 
using const_global_object_iterator = concat_iterator< const GlobalObject, const_iterator, const_global_iterator >
 
using global_value_iterator = concat_iterator< GlobalValue, iterator, global_iterator, alias_iterator, ifunc_iterator >
 
using const_global_value_iterator = concat_iterator< const GlobalValue, const_iterator, const_global_iterator, const_alias_iterator, const_ifunc_iterator >
 
iterator_range< global_object_iteratorglobal_objects ()
 
iterator_range< const_global_object_iteratorglobal_objects () const
 
global_object_iterator global_object_begin ()
 
global_object_iterator global_object_end ()
 
const_global_object_iterator global_object_begin () const
 
const_global_object_iterator global_object_end () const
 
iterator_range< global_value_iteratorglobal_values ()
 
iterator_range< const_global_value_iteratorglobal_values () const
 
global_value_iterator global_value_begin ()
 
global_value_iterator global_value_end ()
 
const_global_value_iterator global_value_begin () const
 
const_global_value_iterator global_value_end () const
 

Detailed 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 GlobalValRefMap object that is used to hold all constant references to global variables in the module. When a global variable is destroyed, it should have no entries in the GlobalValueRefMap. The main container class for the LLVM Intermediate Representation.

Definition at line 65 of file Module.h.

Member Typedef Documentation

◆ alias_iterator

The Global Alias iterators.

Definition at line 98 of file Module.h.

◆ AliasListType

The type for the list of aliases.

Definition at line 74 of file Module.h.

◆ ComdatSymTabType

The type of the comdat "symbol" table.

Definition at line 80 of file Module.h.

◆ const_alias_iterator

The Global Alias constant iterator.

Definition at line 100 of file Module.h.

◆ const_global_iterator

The Global Variable constant iterator.

Definition at line 85 of file Module.h.

◆ const_global_object_iterator

Definition at line 657 of file Module.h.

◆ const_global_value_iterator

Definition at line 683 of file Module.h.

◆ const_ifunc_iterator

The Global IFunc constant iterator.

Definition at line 105 of file Module.h.

◆ const_iterator

The Function constant iterator.

Definition at line 90 of file Module.h.

◆ const_named_metadata_iterator

The named metadata constant iterators.

Definition at line 110 of file Module.h.

◆ const_reverse_iterator

The Function constant reverse iterator.

Definition at line 95 of file Module.h.

◆ FunctionListType

The type for the list of functions.

Definition at line 72 of file Module.h.

◆ global_iterator

The Global Variable iterator.

Definition at line 83 of file Module.h.

◆ global_object_iterator

Definition at line 654 of file Module.h.

◆ global_value_iterator

Definition at line 680 of file Module.h.

◆ GlobalListType

The type for the list of global variables.

Definition at line 70 of file Module.h.

◆ ifunc_iterator

The Global IFunc iterators.

Definition at line 103 of file Module.h.

◆ IFuncListType

The type for the list of ifuncs.

Definition at line 76 of file Module.h.

◆ iterator

The Function iterators.

Definition at line 88 of file Module.h.

◆ named_metadata_iterator

The named metadata iterators.

Definition at line 108 of file Module.h.

◆ NamedMDListType

The type for the list of named metadata.

Definition at line 78 of file Module.h.

◆ reverse_iterator

The Function reverse iterator.

Definition at line 93 of file Module.h.

Member Enumeration Documentation

◆ ModFlagBehavior

This enumeration defines the supported behaviors of module flags.

Enumerator
Error 

Emits an error if two values disagree, otherwise the resulting value is that of the operands.

Warning 

Emits a warning if two values disagree.

The result value will be the operand for the flag from the first module being linked.

Require 

Adds a requirement that another module flag be present and have a specified value after linking is performed.

The value must be a metadata pair, where the first element of the pair is the ID of the module flag to be restricted, and the second element of the pair is the value the module flag should be restricted to. This behavior can be used to restrict the allowable results (via triggering of an error) of linking IDs with the Override behavior.

Override 

Uses the specified value, regardless of the behavior or value of the other module.

If both modules specify Override, but the values differ, an error will be emitted.

Append 

Appends the two values, which are required to be metadata nodes.

AppendUnique 

Appends the two values, which are required to be metadata nodes.

However, duplicate entries in the second list are dropped during the append operation.

Max 

Takes the max of the two values, which are required to be integers.

ModFlagBehaviorFirstVal 
ModFlagBehaviorLastVal 

Definition at line 113 of file Module.h.

Constructor & Destructor Documentation

◆ Module()

Module::Module ( StringRef  ModuleID,
LLVMContext C 
)
explicit

The Module constructor.

Note that there is no default constructor. You must provide a name for the module upon construction.

Definition at line 74 of file Module.cpp.

◆ ~Module()

Module::~Module ( )

The module destructor. This will dropAllReferences.

Definition at line 81 of file Module.cpp.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::clear(), and dropAllReferences().

Member Function Documentation

◆ addModuleFlag() [1/4]

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

Add a module-level flag to the module-level flags metadata.

addModuleFlag - Add a module-level flag to the module-level flags metadata.

It will create the module-level flags named metadata if it doesn't already exist.

Definition at line 339 of file Module.cpp.

References llvm::NamedMDNode::addOperand(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDString::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), getOrInsertModuleFlagsMetadata(), and Int32Ty.

Referenced by addModuleFlag(), llvm::orc::cloneModuleFlagsMetadata(), getNamedGlobal(), llvm::CGProfilePass::run(), setCodeModel(), setPICLevel(), setPIELevel(), setProfileSummary(), setRtLibUseGOT(), setSDKVersion(), and llvm::UpgradeModuleFlags().

◆ addModuleFlag() [2/4]

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

Definition at line 347 of file Module.cpp.

References addModuleFlag(), and llvm::ConstantAsMetadata::get().

◆ addModuleFlag() [3/4]

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

◆ addModuleFlag() [4/4]

void Module::addModuleFlag ( MDNode Node)

Definition at line 356 of file Module.cpp.

◆ alias_begin() [1/2]

alias_iterator llvm::Module::alias_begin ( )
inline

◆ alias_begin() [2/2]

const_alias_iterator llvm::Module::alias_begin ( ) const
inline

Definition at line 618 of file Module.h.

◆ alias_empty()

bool llvm::Module::alias_empty ( ) const
inline

Definition at line 622 of file Module.h.

◆ alias_end() [1/2]

alias_iterator llvm::Module::alias_end ( )
inline

◆ alias_end() [2/2]

const_alias_iterator llvm::Module::alias_end ( ) const
inline

Definition at line 620 of file Module.h.

◆ alias_size()

size_t llvm::Module::alias_size ( ) const
inline

Definition at line 621 of file Module.h.

Referenced by llvm::NVPTXAsmPrinter::doInitialization().

◆ aliases() [1/2]

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

◆ aliases() [2/2]

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

Definition at line 627 of file Module.h.

References alias_begin(), alias_end(), and llvm::make_range().

◆ appendModuleInlineAsm()

void llvm::Module::appendModuleInlineAsm ( StringRef  Asm)
inline

Append to the module-scope inline assembly blocks.

A trailing newline is added if the input doesn't have one.

Definition at line 295 of file Module.h.

References llvm::HexStyle::Asm, getIdentifiedStructTypes(), getMDKindID(), getMDKindNames(), getNamedValue(), getOperandBundleTags(), getOrInsertFunction(), getTypeByName(), and Name.

◆ begin() [1/2]

iterator llvm::Module::begin ( )
inline

◆ begin() [2/2]

const_iterator llvm::Module::begin ( ) const
inline

Definition at line 596 of file Module.h.

◆ createRNG()

std::unique_ptr< RandomNumberGenerator > Module::createRNG ( const Pass P) const

Get a RandomNumberGenerator salted for use with this module.

The RNG can be seeded via -rng-seed=<uint64> and is salted with the ModuleID and the provided pass salt. The returned RNG should not be shared across threads or passes.

A unique RNG per pass ensures a reproducible random stream even when other randomness consuming passes are added or removed. In addition, the random stream will be reproducible across LLVM versions when the pass does not change.

Definition at line 93 of file Module.cpp.

References llvm::sys::path::filename(), getModuleIdentifier(), and llvm::Pass::getPassName().

Referenced by getModuleInlineAsm().

◆ debug_compile_units()

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

◆ debug_compile_units_begin()

debug_compile_units_iterator llvm::Module::debug_compile_units_begin ( ) const
inline

Definition at line 765 of file Module.h.

References getNamedMetadata().

Referenced by llvm::DwarfDebug::beginModule().

◆ debug_compile_units_end()

debug_compile_units_iterator llvm::Module::debug_compile_units_end ( ) const
inline

Definition at line 770 of file Module.h.

References getNamedMetadata().

Referenced by llvm::DwarfDebug::beginModule().

◆ dropAllReferences()

void Module::dropAllReferences ( )

This function causes all the subinstructions to "let go" of all references that they are maintaining.

This allows one to 'delete' a whole class at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is delete'd for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.

Definition at line 441 of file Module.cpp.

References aliases(), llvm::Function::dropAllReferences(), F(), globals(), and ifuncs().

Referenced by debug_compile_units(), and ~Module().

◆ dropTriviallyDeadConstantArrays()

void Module::dropTriviallyDeadConstantArrays ( )

Destroy ConstantArrays in LLVMContext if they are not used.

ConstantArrays constructed during linking can cause quadratic memory explosion. Releasing all unused constants can cause a 20% LTO compile-time slowdown for a large application.

NOTE: Constants are currently owned by LLVMContext. This can then only be called where all uses of the LLVMContext are understood.

Definition at line 160 of file LLVMContextImpl.cpp.

References Context, llvm::LLVMContextImpl::dropTriviallyDeadConstantArrays(), and llvm::LLVMContext::pImpl.

Referenced by debug_compile_units(), and llvm::IRMover::move().

◆ dump()

LLVM_DUMP_METHOD void Module::dump ( ) const

Dump the module to stderr (for debugging).

Definition at line 4306 of file AsmWriter.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, and print().

Referenced by CheckMACMemory(), and debug_compile_units().

◆ empty()

bool llvm::Module::empty ( ) const
inline

◆ end() [1/2]

iterator llvm::Module::end ( )
inline

◆ end() [2/2]

const_iterator llvm::Module::end ( ) const
inline

Definition at line 598 of file Module.h.

◆ eraseNamedMetadata()

void Module::eraseNamedMetadata ( NamedMDNode NMD)

Remove the given NamedMDNode from this module and delete it.

eraseNamedMetadata - Remove the given NamedMDNode from this module and delete it.

Definition at line 274 of file Module.cpp.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::NamedMDNode::getName().

Referenced by getNamedGlobal().

◆ functions() [1/2]

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

◆ functions() [2/2]

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

Definition at line 609 of file Module.h.

References begin(), end(), and llvm::make_range().

◆ getAliasList() [1/2]

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

◆ getAliasList() [2/2]

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

Get the Module's list of aliases.

Definition at line 540 of file Module.h.

◆ getCodeModel()

Optional< CodeModel::Model > Module::getCodeModel ( ) const

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

Definition at line 518 of file Module.cpp.

References getModuleFlag(), and llvm::None.

Referenced by llvm::lto::Config::addSaveTemps(), and debug_compile_units().

◆ getCodeViewFlag()

unsigned Module::getCodeViewFlag ( ) const

Returns the CodeView Version by checking module flags.

Returns zero if not present in module.

Definition at line 470 of file Module.cpp.

References getModuleFlag().

Referenced by debug_compile_units(), llvm::AsmPrinter::doInitialization(), llvm::X86FrameLowering::emitPrologue(), and llvm::X86AsmPrinter::runOnMachineFunction().

◆ getComdatSymbolTable() [1/2]

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

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

Definition at line 570 of file Module.h.

Referenced by createGlobalFwdRef(), getMinVisibility(), llvm::InternalizePass::internalizeModule(), and rewriteComdat().

◆ getComdatSymbolTable() [2/2]

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

Get the Module's symbol table for COMDATs.

Definition at line 572 of file Module.h.

◆ getContext()

LLVMContext& llvm::Module::getContext ( ) const
inline

Get the global data context.

Returns
LLVMContext - a container for LLVM's global information

Definition at line 244 of file Module.h.

References Context.

Referenced by llvm::LTOCodeGenerator::addModule(), llvm::IntrinsicLowering::AddPrototypes(), llvm::AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), annotateAllFunctions(), llvm::annotateValueSite(), appendToGlobalArray(), appendToUsedList(), assureFPCallStub(), llvm::CloneModule(), collectFunctionUsers(), createDevirtTriggerFunc(), createDummyFunction(), llvm::createEfficiencySanitizerPass(), createEmptyFunction(), createFPFnStub(), createFree(), CreateGCRelocates(), llvm::createHWAddressSanitizerPass(), createIRLevelProfileFlagVariable(), CreateLoadIns(), llvm::createPGOFuncNameVar(), createPrivateGlobalForSourceLoc(), llvm::createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::createSampleProfileLoaderPass(), llvm::createSanitizerCtorAndInitFunctions(), llvm::createThreadSanitizerLegacyPassPass(), CreateWrapper(), llvm::createX86RetpolineThunksPass(), llvm::declareSanitizerInitFunction(), doImportingForModule(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::emitMemCpyChk(), EmitMSInlineAsmStr(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), EnsureFPIntrinsicsExist(), llvm::CodeExtractor::findInputsOutputs(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::objcarc::ARCMDKindCache::get(), getChainID(), llvm::getCopyDeclaration(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::AMDGPUMangledLibFunc::getFunctionType(), llvm::TargetLoweringBase::getIRStackGuard(), getMinVisibility(), llvm::getOrCreateInitFunction(), llvm::getOrCreateSanitizerCtorAndInitFunctions(), llvm::AMDGPULibFunc::getOrInsertFunction(), getOrInsertGlobal(), getOrInsertValueProfilingCall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), getSignature(), llvm::InstrProfIncrementInst::getStep(), getSubprogram(), llvm::HexagonTargetLowering::getTgtMemIntrinsic(), llvm::FunctionImporter::importFunctions(), INITIALIZE_PASS(), insertLifetimeMarkersSurroundingCall(), InsertSafepointPoll(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), llvm::TargetLoweringBase::insertSSPDeclarations(), insertUseHolderAfter(), instrumentMaskedLoadOrStore(), instrumentOneFunc(), llvm::DenseMapInfo< VTableSlot >::isEqual(), llvm::log2(), MarkBlocksLiveIn(), llvm::IRMutator::mutateModule(), needsRuntimeRegistrationOfSectionRange(), PushArgMD(), llvm::CGProfilePass::run(), llvm::ScalarizerPass::run(), llvm::WholeProgramDevirtPass::run(), llvm::legacy::PassManagerImpl::run(), llvm::Float2IntPass::runImpl(), llvm::SanitizerStatReport::SanitizerStatReport(), llvm::setIrrLoopHeaderMetadata(), llvm::setProfMetadata(), shouldEmitInstrCountChangedRemark(), llvm::ModulePass::skipModule(), llvm::CallGraphSCCPass::skipSCC(), srcMgrDiagHandler(), llvm::stripNonLineTableDebugInfo(), StripSymbolNames(), SwitchToLookupTable(), switchToSelect(), llvm::lto::thinBackend(), llvm::UpgradeDebugInfo(), llvm::UpgradeModuleFlags(), llvm::UpgradeRetainReleaseMarker(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().

◆ getDataLayout()

const DataLayout & Module::getDataLayout ( ) const

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

Definition at line 371 of file Module.cpp.

Referenced by AddAlignmentAssumptions(), addBoundsChecking(), llvm::LoopAccessInfo::addRuntimeChecks(), llvm::IVUsers::AddUsersImpl(), allCallersPassInValidPointerForArgument(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::GlobalsAAResult::analyzeModule(), llvm::orc::LLJIT::applyDataLayout(), buildFrameType(), llvm::AAResults::callCapturesBefore(), llvm::objcarc::CanAlterRefCount(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), CanProveNotTakenFirstIteration(), llvm::objcarc::CanUse(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::CloneModule(), llvm::FunctionComparator::cmpOperations(), llvm::FunctionComparator::cmpTypes(), collectFunctionUsers(), combineInstructionsOverFunction(), computeAddrSpace(), llvm::ComputeLegalValueVTs(), computeRecurrenceType(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessorsImpl(), computeValueLLTs(), llvm::ConstantFoldCall(), llvm::SanitizerStatReport::create(), llvm::Function::Create(), llvm::createAMDGPUFunctionInliningPass(), llvm::createCodeGenPreparePass(), llvm::createConstantPropagationPass(), llvm::createEfficiencySanitizerPass(), createGlobalFwdRef(), llvm::createHWAddressSanitizerPass(), llvm::createLegacyPMBasicAAResult(), createMaskInstrs(), llvm::createMemDerefPrinter(), llvm::createPPCCTRLoopsVerify(), llvm::createThreadSanitizerLegacyPassPass(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::AMDGPUAAWrapperPass::doInitialization(), llvm::objcarc::ObjCARCAAWrapperPass::doInitialization(), doPromotion(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), eliminateTailRecursion(), llvm::AsmPrinter::EmitAlignment(), llvm::emitCalloc(), EmitCamlGlobal(), llvm::AsmPrinter::EmitDebugValue(), llvm::AsmPrinter::emitGlobalGOTEquivs(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel(), llvm::emitLinkerFlagsForGlobalCOFF(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailablePtrLoadStore(), llvm::CodeExtractor::findInputsOutputs(), findLoadCallsAtConstantOffset(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::StackSafetyInfo::FunctionInfo::FunctionInfo(), llvm::MCJIT::generateCodeForModule(), llvm::MemoryLocation::get(), getAlignment(), getAllocaSizeInBytes(), getAtomicOpAlign(), getAtomicOpSize(), llvm::getBestSimplifyQuery(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRange(), llvm::LazyValueInfo::getConstantRangeOnEdge(), llvm::LLParser::getContext(), llvm::AsmPrinter::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::ScalarEvolution::getDataLayout(), getDataLayoutStr(), llvm::DemandedBits::getDemandedBits(), getEdgeValueLocal(), llvm::AMDGPUSubtarget::getExplicitKernArgSize(), getFirstNonAllocaInTheEntryBlock(), llvm::getGEPInductionOperand(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::getInlineCost(), getIntrinsicForMaskedAtomicRMWBinOp32(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::MemoryDependenceResults::getLoadLoadClobberFullWidthSize(), llvm::ExecutionEngine::getMangledName(), getMinVisibility(), llvm::GlobalsAAResult::getModRefBehavior(), llvm::Mangler::getNameWithPrefix(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), getOrInsertGlobal(), GetPointerOperand(), llvm::LazyValueInfo::getPredicateAt(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::NVPTXTargetLowering::getPrototype(), llvm::getPtrStride(), llvm::SCEVExpander::getRelatedExistingExpansion(), GetRMWLibcall(), getScalarIntrinsicDeclaration(), llvm::TargetLoweringObjectFile::getSectionForJumpTable(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::MipsTargetMachine::getTargetTransformInfo(), llvm::TargetMachine::getTargetTransformInfo(), llvm::HexagonTargetLowering::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), getTypePartition(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), GlobalWasGeneratedByCompiler(), llvm::MipsCallLowering::MipsHandler::handle(), llvm::CallLowering::handleAssignments(), HandleByValArgument(), HandleByValArgumentInit(), handleEndBlock(), handleFree(), hasProfileData(), hasUndefContents(), llvm::hoistRegion(), llvm::DataLayout::init(), INITIALIZE_PASS(), llvm::InlineFunction(), insertIfNamed(), instrumentMaskedLoadOrStore(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), llvm::isAllocaPromotable(), isAlwaysLive(), isAtomic(), llvm::DenseMapInfo< VTableSlot >::isEqual(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), isIgnorableInst(), llvm::InductionDescriptor::isInductionPHI(), llvm::isLegalToPromote(), isLoadConditional(), isLoadInvariantInLoop(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), IsOperandAMemoryOperand(), isPointerValueDeadOnEntryToFunction(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), llvm::isSafeToSpeculativelyExecute(), IsSmallObject(), llvm::LoopVectorizationLegality::isUniform(), isZero(), llvm::AArch64TargetLowering::isZExtFree(), llvm::LibCallSimplifier::LibCallSimplifier(), llvm::X86CallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::AMDGPUCallLowering::lowerReturn(), llvm::AArch64CallLowering::lowerReturn(), MarkBlocksLiveIn(), llvm::gvn::AvailableValue::MaterializeAdjustedValue(), maybePrintCallAddrSpace(), maybePrintComdat(), mayLoopAccessLocation(), mayUsePostIncMode(), memOpsHaveSameBasePtr(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), mergeInlinedArrayAllocas(), moveUp(), operator<<(), OptimizeGlobalVars(), patchAndReplaceAllUsesWith(), performGlobalAddressCombine(), llvm::MemoryDepChecker::Dependence::print(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processInternalGlobal(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), RedzoneSizeForScale(), relocationViaAlloca(), llvm::replaceAllDbgUsesWith(), replaceAndRecursivelySimplifyImpl(), replaceFrameSize(), ReplaceUsesOfWith(), reportMayClobberedLoad(), llvm::returnTypeIsEligibleForTailCall(), llvm::LoopRotatePass::run(), llvm::NewGVNPass::run(), llvm::GlobalOptPass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::IPSCCPPass::run(), llvm::EarlyCSEPass::run(), llvm::InstSimplifyPass::run(), llvm::SCCPPass::run(), llvm::AAEvaluator::run(), llvm::AMDGPUAA::run(), llvm::objcarc::ObjCARCAA::run(), llvm::LazyValueAnalysis::run(), llvm::WholeProgramDevirtPass::run(), llvm::BasicAA::run(), llvm::TargetIRAnalysis::run(), llvm::SLPVectorizerPass::runImpl(), llvm::NaryReassociatePass::runImpl(), llvm::ConstantHoistingPass::runImpl(), runImpl(), llvm::LazyValueInfoWrapperPass::runOnFunction(), llvm::BasicAAWrapperPass::runOnFunction(), llvm::IRTranslator::runOnMachineFunction(), selectELFSectionForGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), llvm::HexagonTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::HexagonTargetObjectFile::shouldPutJumpTableInFunctionSection(), llvm::simplifyCFG(), llvm::SimplifyInstructionsInBlock(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), AllocaSlices::SliceBuilder::SliceBuilder(), splitGlobal(), splitMergedValStore(), StackMallocSizeClass(), llvm::LazyValueInfo::threadEdge(), llvm::JumpThreadingPass::ThreadGuard(), tryToVectorizeHorReductionOrInstOperands(), TypeSizeToSizeIndex(), llvm::UnrollRuntimeLoopRemainder(), llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::updatePointer(), valueCoversEntireFragment(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), llvm::LoopVersioning::versionLoop(), visitIVCast(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().

◆ getDataLayoutStr()

const std::string& llvm::Module::getDataLayoutStr ( ) const
inline

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

This is equivalent to getDataLayout()->getStringRepresentation().

Definition at line 231 of file Module.h.

References getDataLayout(), and llvm::DataLayout::getStringRepresentation().

Referenced by getStringEncoding().

◆ getDwarfVersion()

unsigned Module::getDwarfVersion ( ) const

Returns the Dwarf Version by checking module flags.

Definition at line 463 of file Module.cpp.

References getModuleFlag().

Referenced by debug_compile_units(), llvm::AsmPrinter::doInitialization(), and llvm::DwarfDebug::DwarfDebug().

◆ getFunction()

Function * Module::getFunction ( StringRef  Name) const

◆ getFunctionList() [1/2]

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

◆ getFunctionList() [2/2]

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

Get the Module's list of functions.

Definition at line 532 of file Module.h.

◆ getGlobalList() [1/2]

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

◆ getGlobalList() [2/2]

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

Get the Module's list of global variables.

Definition at line 523 of file Module.h.

◆ getGlobalVariable() [1/3]

GlobalVariable* llvm::Module::getGlobalVariable ( StringRef  Name) const
inline

Look up the specified global variable in the module symbol table.

If it does not exist, return null. If AllowInternal is set to true, this function will return types that have InternalLinkage. By default, these types are not returned.

Definition at line 387 of file Module.h.

Referenced by appendToUsedList(), llvm::collectUsedGlobalVariables(), findGlobalCtors(), llvm::MCJIT::findModuleForSymbol(), getGlobalVariable(), getNamedGlobal(), llvm::AArch64TargetLowering::getSDagStackGuard(), llvm::X86TargetLowering::getSDagStackGuard(), INITIALIZE_PASS(), instrumentMaskedLoadOrStore(), mergeConstants(), needsRuntimeRegistrationOfSectionRange(), rewriteComdat(), and StripSymbolNames().

◆ getGlobalVariable() [2/3]

GlobalVariable * Module::getGlobalVariable ( StringRef  Name,
bool  AllowLocal 
) const

getGlobalVariable - Look up the specified global variable in the module symbol table.

If it does not exist, return null. The type argument should be the underlying type of the global, i.e., it should not have the top-level PointerType, which represents the address of the global. If AllowLocal is set to true, this function will return types that have an local. By default, these types are not returned.

Definition at line 191 of file Module.cpp.

References getNamedValue().

◆ getGlobalVariable() [3/3]

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

Definition at line 393 of file Module.h.

References getGlobalVariable().

◆ getIdentifiedStructTypes()

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

◆ getIFuncList() [1/2]

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

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

Definition at line 547 of file Module.h.

Referenced by llvm::GlobalIFunc::eraseFromParent(), maybeSetDSOLocal(), llvm::GlobalIFunc::removeFromParent(), and llvm::GlobalAlias::setAliasee().

◆ getIFuncList() [2/2]

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

Get the Module's list of ifuncs.

Definition at line 549 of file Module.h.

◆ getInstructionCount()

unsigned Module::getInstructionCount ( )

Returns the number of non-debug IR instructions in the module.

This is equivalent to the sum of the IR instruction counts of each function contained in the module.

Definition at line 477 of file Module.cpp.

References F().

Referenced by llvm::FPPassManager::doFinalization(), and getModuleIdentifier().

◆ getMaterializer()

GVMaterializer* llvm::Module::getMaterializer ( ) const
inline

Retrieves the GVMaterializer, if any, for this Module.

Definition at line 504 of file Module.h.

Referenced by isMaterialized().

◆ getMDKindID()

unsigned Module::getMDKindID ( StringRef  Name) const

Return a unique non-zero ID for the specified metadata kind.

getMDKindID - Return a unique non-zero ID for the specified metadata kind.

This ID is uniqued across modules in the current LLVMContext.

Definition at line 120 of file Module.cpp.

References llvm::LLVMContext::getMDKindID().

Referenced by appendModuleInlineAsm(), and parseOptionalLinkageAux().

◆ getMDKindNames()

void Module::getMDKindNames ( SmallVectorImpl< StringRef > &  Result) const

Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext.

getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMContext.

ID #0 is not used, so it is filled in as an empty string.

Definition at line 127 of file Module.cpp.

References llvm::LLVMContext::getMDKindNames().

Referenced by appendModuleInlineAsm().

◆ getModuleFlag()

Metadata * Module::getModuleFlag ( StringRef  Key) const

◆ getModuleFlagsMetadata() [1/2]

void Module::getModuleFlagsMetadata ( SmallVectorImpl< ModuleFlagEntry > &  Flags) const

Returns the module flags in the provided vector.

getModuleFlagsMetadata - Returns the module flags in the provided vector.

Definition at line 292 of file Module.cpp.

References getModuleFlagsMetadata(), isValidModFlagBehavior(), llvm::NamedMDNode::operands(), and llvm::SmallVectorTemplateBase< T >::push_back().

Referenced by llvm::orc::cloneModuleFlagsMetadata(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), GetObjCImageInfo(), and llvm::UpgradeModuleFlags().

◆ getModuleFlagsMetadata() [2/2]

NamedMDNode * Module::getModuleFlagsMetadata ( ) const

Returns the NamedMDNode in the module that represents module-level flags.

getModuleFlagsMetadata - Returns the NamedMDNode in the module that represents module-level flags.

This method returns null if there are no module-level flags.

Definition at line 325 of file Module.cpp.

References getNamedMetadata().

Referenced by getModuleFlag(), getModuleFlagsMetadata(), getNamedGlobal(), and isValidModFlagBehavior().

◆ getModuleIdentifier()

const std::string& llvm::Module::getModuleIdentifier ( ) const
inline

◆ getModuleInlineAsm()

const std::string& llvm::Module::getModuleInlineAsm ( ) const
inline

◆ getName()

StringRef llvm::Module::getName ( ) const
inline

Get a short "name" for the module.

This is useful for debugging or logging. It is essentially a convenience wrapper around getModuleIdentifier().

Definition at line 227 of file Module.h.

Referenced by llvm::orc::cloneToNewContext(), llvm::createHWAddressSanitizerPass(), dumpIR(), getDescription(), llvm::StackSafetyGlobalPrinterPass::run(), llvm::ProfileSummaryPrinterPass::run(), llvm::ImportedFunctionsInliningStatistics::setModuleInfo(), and shouldApply().

◆ getNamedAlias()

GlobalAlias * Module::getNamedAlias ( StringRef  Name) const

Return the global alias in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

Definition at line 241 of file Module.cpp.

References getNamedValue().

Referenced by getNamedGlobal(), and rewriteComdat().

◆ getNamedGlobal() [1/2]

const GlobalVariable* llvm::Module::getNamedGlobal ( StringRef  Name) const
inline

Return the global variable in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

Definition at line 402 of file Module.h.

References getGlobalVariable().

Referenced by appendToGlobalArray(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::orc::getConstructors(), llvm::orc::getDestructors(), getGlobalVariableI32(), getNamedGlobal(), INITIALIZE_PASS(), llvm::isIRPGOFlagSet(), llvm::TargetLowering::LowerToTLSEmulatedModel(), llvm::InstrProfiling::run(), and llvm::ExecutionEngine::runStaticConstructorsDestructors().

◆ getNamedGlobal() [2/2]

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

◆ getNamedIFunc()

GlobalIFunc * Module::getNamedIFunc ( StringRef  Name) const

Return the global ifunc in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

Definition at line 245 of file Module.cpp.

References getNamedValue().

Referenced by getNamedGlobal().

◆ getNamedMDList() [1/2]

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

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

Definition at line 556 of file Module.h.

◆ getNamedMDList() [2/2]

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

Get the Module's list of named metadata.

Definition at line 558 of file Module.h.

◆ getNamedMetadata()

NamedMDNode * Module::getNamedMetadata ( const Twine Name) const

◆ getNamedValue()

GlobalValue * Module::getNamedValue ( StringRef  Name) const

◆ getNumberRegisterParameters()

unsigned Module::getNumberRegisterParameters ( ) const

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

Definition at line 455 of file Module.cpp.

References getModuleFlag().

Referenced by debug_compile_units().

◆ getOperandBundleTags()

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.

See also
LLVMContext::getOperandBundleTagID

Definition at line 131 of file Module.cpp.

References llvm::LLVMContext::getOperandBundleTags().

Referenced by appendModuleInlineAsm().

◆ getOrInsertComdat()

Comdat * Module::getOrInsertComdat ( StringRef  Name)

◆ getOrInsertFunction() [1/5]

Constant * Module::getOrInsertFunction ( StringRef  Name,
FunctionType T,
AttributeList  AttributeList 
)

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. If it exists, and has a local linkage, the existing function is renamed and a new one is inserted.
  3. Otherwise, if the existing function has the correct prototype, return the existing function.
  4. Finally, the function exists but has the wrong prototype: return the function with a constantexpr cast to the right prototype.

Definition at line 144 of file Module.cpp.

References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F(), llvm::PointerType::get(), llvm::GlobalValue::getAddressSpace(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::DataLayout::getProgramAddressSpace(), llvm::GlobalValue::getType(), llvm::Function::isIntrinsic(), Name, llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back(), and llvm::Function::setAttributes().

Referenced by appendModuleInlineAsm(), llvm::SanitizerStatReport::create(), createDummyFunction(), llvm::createEfficiencySanitizerPass(), createFree(), llvm::createHWAddressSanitizerPass(), createMalloc(), createPrivateNonConstGlobalForString(), CreatePrologue(), llvm::createSanitizerCtorAndInitFunctions(), llvm::createThreadSanitizerLegacyPassPass(), llvm::declareSanitizerInitFunction(), llvm::emitBinaryFloatFnCall(), llvm::emitCalloc(), llvm::emitFGetCUnlocked(), llvm::emitFGetSUnlocked(), llvm::emitFPutC(), llvm::emitFPutCUnlocked(), llvm::emitFPutS(), llvm::emitFPutSUnlocked(), llvm::emitFReadUnlocked(), llvm::emitFWrite(), llvm::emitFWriteUnlocked(), llvm::emitMalloc(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::emitPutChar(), llvm::emitPutS(), llvm::emitStrChr(), llvm::emitStrCpy(), llvm::emitStrLen(), llvm::emitStrNCmp(), llvm::emitStrNCpy(), emitUnaryFloatFnCallHelper(), EnsureFunctionExists(), eraseDeadBBsAndChildren(), llvm::SanitizerStatReport::finish(), fixupFPReturnAndCall(), llvm::getCopyDeclaration(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::Intrinsic::getDeclaration(), getDefaultPersonalityFn(), getOrInsertFunction(), llvm::AMDGPULibFunc::getOrInsertFunction(), getOrInsertGlobal(), getOrInsertValueProfilingCall(), GetRMWLibcall(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), getSqrtCall(), INITIALIZE_PASS(), insertCall(), insertSinCosCall(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), insertUseHolderAfter(), instrumentMaskedLoadOrStore(), isReportingError(), lowerObjCCall(), makeStatepointExplicitImpl(), MarkBlocksLiveIn(), mayLoopAccessLocation(), PushArgMD(), ReplaceCallWith(), and shouldKeepInEntry().

◆ getOrInsertFunction() [2/5]

Constant * Module::getOrInsertFunction ( StringRef  Name,
FunctionType T 
)

Definition at line 168 of file Module.cpp.

References getOrInsertFunction().

◆ getOrInsertFunction() [3/5]

template<typename... ArgsTy>
Constant* llvm::Module::getOrInsertFunction ( StringRef  Name,
AttributeList  AttributeList,
Type RetTy,
ArgsTy...  Args 
)
inline

Look up the specified function in the module symbol table.

If it does not exist, add a prototype for the function and return it. This function guarantees to return a constant of pointer to the specified function type or a ConstantExpr BitCast of that type if the named function has a different type. This version of the method takes a list of function arguments, which makes it easier for clients to use.

Definition at line 354 of file Module.h.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::FunctionType::get(), and getOrInsertFunction().

◆ getOrInsertFunction() [4/5]

template<typename... ArgsTy>
Constant* llvm::Module::getOrInsertFunction ( StringRef  Name,
Type RetTy,
ArgsTy...  Args 
)
inline

Same as above, but without the attributes.

Definition at line 366 of file Module.h.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, getFunction(), getOrInsertFunction(), and llvm::AArch64CC::Invalid.

◆ getOrInsertFunction() [5/5]

template<typename... ArgsTy>
Constant* llvm::Module::getOrInsertFunction ( StringRef  Name,
AttributeList  AttributeList,
FunctionType Invalid,
ArgsTy...  Args 
)
delete

◆ getOrInsertGlobal() [1/2]

Constant * Module::getOrInsertGlobal ( StringRef  Name,
Type Ty,
function_ref< GlobalVariable *()>  CreateGlobalCallback 
)

Look up the specified global in the module symbol table.

getOrInsertGlobal - Look up the specified global in the module symbol table.

If it does not exist, invoke a callback to create a declaration of the global and return it. The global is constantexpr casted to the expected type if necessary.

  1. If it does not exist, add a declaration of the global and return it.
  2. Else, the global exists but has the wrong type: return the function with a constantexpr cast to the right type.
  3. Finally, if the existing global is the correct declaration, return the existing global.

Definition at line 206 of file Module.cpp.

References assert(), llvm::PointerType::get(), llvm::ConstantExpr::getBitCast(), getNamedValue(), llvm::Type::getPointerAddressSpace(), and llvm::GlobalValue::getType().

Referenced by llvm::createHWAddressSanitizerPass(), eraseDeadBBsAndChildren(), llvm::TargetLoweringBase::getIRStackGuard(), getNamedGlobal(), getOrInsertGlobal(), getOrInsertGlobal(), INITIALIZE_PASS(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), instrumentMaskedLoadOrStore(), llvm::WholeProgramDevirtPass::run(), and StackMallocSizeClass().

◆ getOrInsertGlobal() [2/2]

Constant * 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 227 of file Module.cpp.

References llvm::GlobalValue::ExternalLinkage, and getOrInsertGlobal().

◆ getOrInsertModuleFlagsMetadata()

NamedMDNode * Module::getOrInsertModuleFlagsMetadata ( )

Returns the NamedMDNode in the module that represents module-level flags.

getOrInsertModuleFlagsMetadata - Returns the NamedMDNode in the module that represents module-level flags.

If module-level flags aren't found, it creates the named metadata that contains them.

Definition at line 332 of file Module.cpp.

References getOrInsertNamedMetadata().

Referenced by addModuleFlag(), and getNamedGlobal().

◆ getOrInsertNamedMetadata()

NamedMDNode * Module::getOrInsertNamedMetadata ( StringRef  Name)

Return the named MDNode in the module with the specified name.

getOrInsertNamedMetadata - Return the first named MDNode in the module with the specified name.

This method returns a new NamedMDNode if a NamedMDNode with the specified name is not found.

Definition at line 261 of file Module.cpp.

References Name, and llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back().

Referenced by llvm::DIBuilder::createCompileUnit(), getNamedGlobal(), getOrInsertModuleFlagsMetadata(), and StripSymbolNames().

◆ getPICLevel()

PICLevel::Level Module::getPICLevel ( ) const

◆ getPIELevel()

PIELevel::Level Module::getPIELevel ( ) const

Returns the PIE level (small or large model)

Definition at line 504 of file Module.cpp.

References llvm::PIELevel::Default, and getModuleFlag().

Referenced by debug_compile_units(), llvm::TargetMachine::getTLSModel(), and llvm::TargetMachine::shouldAssumeDSOLocal().

◆ getProfileSummary()

Metadata * Module::getProfileSummary ( )

Returns profile summary metadata.

Definition at line 540 of file Module.cpp.

References getModuleFlag().

Referenced by llvm::createSampleProfileLoaderPass(), debug_compile_units(), and getEntryForPercentile().

◆ getRtLibUseGOT()

bool Module::getRtLibUseGOT ( ) const

Returns true if PLT should be avoided for RTLib calls.

Definition at line 548 of file Module.cpp.

References getModuleFlag().

Referenced by llvm::X86Subtarget::classifyGlobalFunctionReference(), debug_compile_units(), llvm::inferLibFuncAttributes(), and llvm::TargetMachine::shouldAssumeDSOLocal().

◆ getSDKVersion()

VersionTuple Module::getSDKVersion ( ) const

Get the build SDK version metadata.

An empty version is returned if no such metadata is attached.

Definition at line 571 of file Module.cpp.

References getModuleFlag(), and llvm::None.

Referenced by debug_compile_units(), and llvm::AsmPrinter::doInitialization().

◆ getSourceFileName()

const std::string& llvm::Module::getSourceFileName ( ) const
inline

Get the module's original source file name.

When compiling from bitcode, this is taken from a bitcode record where it was recorded. For other compiles it is the same as the ModuleID, which would contain the source file name.

Definition at line 221 of file Module.h.

Referenced by llvm::CloneModule(), llvm::AsmPrinter::doInitialization(), llvm::getPGOFuncName(), llvm::thinLTOInternalizeModule(), and llvm::WriteIndexToFile().

◆ getSublistAccess() [1/5]

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

Definition at line 525 of file Module.h.

◆ getSublistAccess() [2/5]

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

Definition at line 533 of file Module.h.

◆ getSublistAccess() [3/5]

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

Definition at line 542 of file Module.h.

◆ getSublistAccess() [4/5]

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

Definition at line 551 of file Module.h.

◆ getSublistAccess() [5/5]

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

Definition at line 560 of file Module.h.

◆ getTargetTriple()

const std::string& llvm::Module::getTargetTriple ( ) const
inline

◆ getTypeByName()

StructType * Module::getTypeByName ( StringRef  Name) const

Return the type with the specified name, or null if there is none by that name.

Definition at line 522 of file Type.cpp.

References llvm::Type::getContext(), llvm::LLVMContextImpl::NamedStructTypes, and llvm::LLVMContext::pImpl.

Referenced by appendModuleInlineAsm().

◆ getValueSymbolTable() [1/2]

const ValueSymbolTable& llvm::Module::getValueSymbolTable ( ) const
inline

Get the symbol table of global variable and function identifiers.

Definition at line 565 of file Module.h.

Referenced by createGlobalFwdRef(), llvm::createSampleProfileLoaderPass(), llvm::AMDGPULibFunc::getFunction(), getNamedValue(), and llvm::AMDGPULibFunc::getOrInsertFunction().

◆ getValueSymbolTable() [2/2]

ValueSymbolTable& llvm::Module::getValueSymbolTable ( )
inline

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

Definition at line 567 of file Module.h.

◆ global_begin() [1/2]

global_iterator llvm::Module::global_begin ( )
inline

◆ global_begin() [2/2]

const_global_iterator llvm::Module::global_begin ( ) const
inline

Definition at line 579 of file Module.h.

◆ global_empty()

bool llvm::Module::global_empty ( ) const
inline

Definition at line 582 of file Module.h.

◆ global_end() [1/2]

global_iterator llvm::Module::global_end ( )
inline

◆ global_end() [2/2]

const_global_iterator llvm::Module::global_end ( ) const
inline

Definition at line 581 of file Module.h.

◆ global_object_begin() [1/2]

global_object_iterator llvm::Module::global_object_begin ( )
inline

Definition at line 666 of file Module.h.

References global_objects().

◆ global_object_begin() [2/2]

const_global_object_iterator llvm::Module::global_object_begin ( ) const
inline

Definition at line 671 of file Module.h.

References global_objects().

◆ global_object_end() [1/2]

global_object_iterator llvm::Module::global_object_end ( )
inline

Definition at line 669 of file Module.h.

References global_objects().

◆ global_object_end() [2/2]

const_global_object_iterator llvm::Module::global_object_end ( ) const
inline

Definition at line 674 of file Module.h.

References global_objects().

◆ global_objects() [1/2]

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

◆ global_objects() [2/2]

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

Definition at line 662 of file Module.h.

References functions(), and globals().

◆ global_value_begin() [1/2]

global_value_iterator llvm::Module::global_value_begin ( )
inline

Definition at line 693 of file Module.h.

References global_values().

◆ global_value_begin() [2/2]

const_global_value_iterator llvm::Module::global_value_begin ( ) const
inline

Definition at line 696 of file Module.h.

References global_values().

◆ global_value_end() [1/2]

global_value_iterator llvm::Module::global_value_end ( )
inline

Definition at line 694 of file Module.h.

References global_values().

◆ global_value_end() [2/2]

const_global_value_iterator llvm::Module::global_value_end ( ) const
inline

Definition at line 699 of file Module.h.

References global_values().

◆ global_values() [1/2]

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

◆ global_values() [2/2]

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

Definition at line 688 of file Module.h.

References aliases(), functions(), globals(), and ifuncs().

◆ globals() [1/2]

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

◆ globals() [2/2]

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

Definition at line 587 of file Module.h.

References global_begin(), global_end(), and llvm::make_range().

◆ ifunc_begin() [1/2]

ifunc_iterator llvm::Module::ifunc_begin ( )
inline

Definition at line 635 of file Module.h.

Referenced by ifuncs().

◆ ifunc_begin() [2/2]

const_ifunc_iterator llvm::Module::ifunc_begin ( ) const
inline

Definition at line 636 of file Module.h.

◆ ifunc_empty()

bool llvm::Module::ifunc_empty ( ) const
inline

Definition at line 640 of file Module.h.

◆ ifunc_end() [1/2]

ifunc_iterator llvm::Module::ifunc_end ( )
inline

Definition at line 637 of file Module.h.

Referenced by ifuncs().

◆ ifunc_end() [2/2]

const_ifunc_iterator llvm::Module::ifunc_end ( ) const
inline

Definition at line 638 of file Module.h.

◆ ifunc_size()

size_t llvm::Module::ifunc_size ( ) const
inline

Definition at line 639 of file Module.h.

◆ ifuncs() [1/2]

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

Definition at line 642 of file Module.h.

References ifunc_begin(), ifunc_end(), and llvm::make_range().

Referenced by dropAllReferences(), global_values(), and orderModule().

◆ ifuncs() [2/2]

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

Definition at line 645 of file Module.h.

References ifunc_begin(), ifunc_end(), and llvm::make_range().

◆ isMaterialized()

bool llvm::Module::isMaterialized ( ) const
inline

◆ isValidModFlagBehavior()

bool Module::isValidModFlagBehavior ( Metadata MD,
ModFlagBehavior MFB 
)
static

Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.

Definition at line 279 of file Module.cpp.

References getModuleFlagsMetadata(), ModFlagBehaviorFirstVal, and ModFlagBehaviorLastVal.

Referenced by getModuleFlagsMetadata().

◆ materialize()

Error Module::materialize ( GlobalValue GV)

Make sure the GlobalValue is fully read.

Definition at line 396 of file Module.cpp.

References llvm::Error::success().

Referenced by isMaterialized(), and llvm::GlobalValue::materialize().

◆ materializeAll()

Error Module::materializeAll ( )

Make sure all GlobalValues in this Module are fully read and clear the Materializer.

Definition at line 403 of file Module.cpp.

References llvm::Error::success().

Referenced by llvm::MCJIT::emitObject(), and isMaterialized().

◆ materializeMetadata()

Error Module::materializeMetadata ( )

Definition at line 410 of file Module.cpp.

References llvm::Error::success().

Referenced by isMaterialized().

◆ named_metadata() [1/2]

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

◆ named_metadata() [2/2]

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

Definition at line 723 of file Module.h.

References llvm::make_range(), named_metadata_begin(), and named_metadata_end().

◆ named_metadata_begin() [1/2]

named_metadata_iterator llvm::Module::named_metadata_begin ( )
inline

◆ named_metadata_begin() [2/2]

const_named_metadata_iterator llvm::Module::named_metadata_begin ( ) const
inline

Definition at line 708 of file Module.h.

◆ named_metadata_empty()

bool llvm::Module::named_metadata_empty ( ) const
inline

Definition at line 718 of file Module.h.

Referenced by rotateSign().

◆ named_metadata_end() [1/2]

named_metadata_iterator llvm::Module::named_metadata_end ( )
inline

◆ named_metadata_end() [2/2]

const_named_metadata_iterator llvm::Module::named_metadata_end ( ) const
inline

Definition at line 713 of file Module.h.

◆ named_metadata_size()

size_t llvm::Module::named_metadata_size ( ) const
inline

Definition at line 717 of file Module.h.

◆ print()

void Module::print ( raw_ostream OS,
AssemblyAnnotationWriter AAW,
bool  ShouldPreserveUseListOrder = false,
bool  IsForDebug = false 
) const

Print the module to an output stream with an optional AssemblyAnnotationWriter.

If ShouldPreserveUseListOrder, then include uselistorder directives so that use-lists can be recreated when reading the assembly.

Definition at line 4065 of file AsmWriter.cpp.

References llvm::RISCVFenceField::W.

Referenced by debug_compile_units(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::operator<<(), llvm::yaml::BlockScalarTraits< Module >::output(), and llvm::PrintModulePass::run().

◆ rbegin() [1/2]

reverse_iterator llvm::Module::rbegin ( )
inline

Definition at line 599 of file Module.h.

Referenced by predictUseListOrder().

◆ rbegin() [2/2]

const_reverse_iterator llvm::Module::rbegin ( ) const
inline

Definition at line 600 of file Module.h.

◆ rend() [1/2]

reverse_iterator llvm::Module::rend ( )
inline

Definition at line 601 of file Module.h.

Referenced by predictUseListOrder().

◆ rend() [2/2]

const_reverse_iterator llvm::Module::rend ( ) const
inline

Definition at line 602 of file Module.h.

◆ setCodeModel()

void Module::setCodeModel ( CodeModel::Model  CL)

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

Definition at line 528 of file Module.cpp.

References addModuleFlag(), and llvm::Error.

Referenced by debug_compile_units().

◆ setDataLayout() [1/2]

void Module::setDataLayout ( StringRef  Desc)

Set the data layout.

Definition at line 365 of file Module.cpp.

References llvm::DataLayout::reset().

Referenced by llvm::orc::LLJIT::applyDataLayout(), LLVMTargetMachineEmit(), and setSourceFileName().

◆ setDataLayout() [2/2]

void Module::setDataLayout ( const DataLayout Other)

Definition at line 369 of file Module.cpp.

◆ setMaterializer()

void Module::setMaterializer ( GVMaterializer GVM)

Sets the GVMaterializer to GVM.

This module must not yet have a Materializer. To reset the materializer for a module that already has one, call materializeAll first. Destroying this module will destroy its materializer without materializing any more GlobalValues. Without destroying the Module, there is no way to detach or destroy a materializer without materializing all the GVs it controls, to avoid leaving orphan unmaterialized GVs.

Definition at line 389 of file Module.cpp.

References assert().

Referenced by llvm::getBitcodeFileContents().

◆ setModuleIdentifier()

void llvm::Module::setModuleIdentifier ( StringRef  ID)
inline

Set the module identifier.

Definition at line 273 of file Module.h.

◆ setModuleInlineAsm()

void llvm::Module::setModuleInlineAsm ( StringRef  Asm)
inline

Set the module-scope inline assembly blocks.

A trailing newline is added if the input doesn't have one.

Definition at line 287 of file Module.h.

References llvm::HexStyle::Asm.

Referenced by INITIALIZE_PASS(), and makeVisible().

◆ setOwnedMemoryBuffer()

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

Take ownership of the given memory buffer.

Definition at line 544 of file Module.cpp.

Referenced by debug_compile_units().

◆ setPICLevel()

void Module::setPICLevel ( PICLevel::Level  PL)

Set the PIC level (small or large model)

Definition at line 500 of file Module.cpp.

References addModuleFlag().

Referenced by debug_compile_units().

◆ setPIELevel()

void Module::setPIELevel ( PIELevel::Level  PL)

Set the PIE level (small or large model)

Definition at line 514 of file Module.cpp.

References addModuleFlag().

Referenced by debug_compile_units().

◆ setProfileSummary()

void Module::setProfileSummary ( Metadata M)

Attach profile summary metadata to this module.

Definition at line 536 of file Module.cpp.

References addModuleFlag(), and llvm::Error.

Referenced by llvm::createSampleProfileLoaderPass(), and debug_compile_units().

◆ setRtLibUseGOT()

void Module::setRtLibUseGOT ( )

Set that PLT should be avoid for RTLib calls.

Definition at line 553 of file Module.cpp.

References addModuleFlag().

Referenced by debug_compile_units().

◆ setSDKVersion()

void Module::setSDKVersion ( const VersionTuple V)

◆ setSourceFileName()

void llvm::Module::setSourceFileName ( StringRef  Name)
inline

Set the module's original source file name.

Definition at line 276 of file Module.h.

References Name, Other, and setDataLayout().

◆ setTargetTriple()

void llvm::Module::setTargetTriple ( StringRef  T)
inline

Set the target triple.

Definition at line 283 of file Module.h.

References T.

Referenced by llvm::LTOModule::setTargetTriple().

◆ shouldEmitInstrCountChangedRemark()

bool llvm::Module::shouldEmitInstrCountChangedRemark ( )
inline

◆ size()

size_t llvm::Module::size ( ) const
inline

Friends And Related Function Documentation

◆ Constant

friend class Constant
friend

Definition at line 192 of file Module.h.


The documentation for this class was generated from the following files: