Project Alice
Loading...
Searching...
No Matches
Collaboration diagram for Modules:

Functions

LLVMModuleRef LLVMModuleCreateWithName (const char *ModuleID)
 
LLVMModuleRef LLVMModuleCreateWithNameInContext (const char *ModuleID, LLVMContextRef C)
 
LLVMModuleRef LLVMCloneModule (LLVMModuleRef M)
 
void LLVMDisposeModule (LLVMModuleRef M)
 
const char * LLVMGetModuleIdentifier (LLVMModuleRef M, size_t *Len)
 
void LLVMSetModuleIdentifier (LLVMModuleRef M, const char *Ident, size_t Len)
 
const char * LLVMGetSourceFileName (LLVMModuleRef M, size_t *Len)
 
void LLVMSetSourceFileName (LLVMModuleRef M, const char *Name, size_t Len)
 
const char * LLVMGetDataLayoutStr (LLVMModuleRef M)
 
const char * LLVMGetDataLayout (LLVMModuleRef M)
 
void LLVMSetDataLayout (LLVMModuleRef M, const char *DataLayoutStr)
 
const char * LLVMGetTarget (LLVMModuleRef M)
 
void LLVMSetTarget (LLVMModuleRef M, const char *Triple)
 
LLVMModuleFlagEntryLLVMCopyModuleFlagsMetadata (LLVMModuleRef M, size_t *Len)
 
void LLVMDisposeModuleFlagsMetadata (LLVMModuleFlagEntry *Entries)
 
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior (LLVMModuleFlagEntry *Entries, unsigned Index)
 
const char * LLVMModuleFlagEntriesGetKey (LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len)
 
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata (LLVMModuleFlagEntry *Entries, unsigned Index)
 
LLVMMetadataRef LLVMGetModuleFlag (LLVMModuleRef M, const char *Key, size_t KeyLen)
 
void LLVMAddModuleFlag (LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, const char *Key, size_t KeyLen, LLVMMetadataRef Val)
 
void LLVMDumpModule (LLVMModuleRef M)
 
LLVMBool LLVMPrintModuleToFile (LLVMModuleRef M, const char *Filename, char **ErrorMessage)
 
char * LLVMPrintModuleToString (LLVMModuleRef M)
 
const char * LLVMGetModuleInlineAsm (LLVMModuleRef M, size_t *Len)
 
void LLVMSetModuleInlineAsm2 (LLVMModuleRef M, const char *Asm, size_t Len)
 
void LLVMAppendModuleInlineAsm (LLVMModuleRef M, const char *Asm, size_t Len)
 
LLVMValueRef LLVMGetInlineAsm (LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize, const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect, LLVMBool CanThrow)
 
const char * LLVMGetInlineAsmAsmString (LLVMValueRef InlineAsmVal, size_t *Len)
 
const char * LLVMGetInlineAsmConstraintString (LLVMValueRef InlineAsmVal, size_t *Len)
 
LLVMInlineAsmDialect LLVMGetInlineAsmDialect (LLVMValueRef InlineAsmVal)
 
LLVMTypeRef LLVMGetInlineAsmFunctionType (LLVMValueRef InlineAsmVal)
 
LLVMBool LLVMGetInlineAsmHasSideEffects (LLVMValueRef InlineAsmVal)
 
LLVMBool LLVMGetInlineAsmNeedsAlignedStack (LLVMValueRef InlineAsmVal)
 
LLVMBool LLVMGetInlineAsmCanUnwind (LLVMValueRef InlineAsmVal)
 
LLVMContextRef LLVMGetModuleContext (LLVMModuleRef M)
 
LLVMTypeRef LLVMGetTypeByName (LLVMModuleRef M, const char *Name)
 
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata (LLVMModuleRef M)
 
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata (LLVMModuleRef M)
 
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata (LLVMNamedMDNodeRef NamedMDNode)
 
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata (LLVMNamedMDNodeRef NamedMDNode)
 
LLVMNamedMDNodeRef LLVMGetNamedMetadata (LLVMModuleRef M, const char *Name, size_t NameLen)
 
LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata (LLVMModuleRef M, const char *Name, size_t NameLen)
 
const char * LLVMGetNamedMetadataName (LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
 
unsigned LLVMGetNamedMetadataNumOperands (LLVMModuleRef M, const char *Name)
 
void LLVMGetNamedMetadataOperands (LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
 
void LLVMAddNamedMetadataOperand (LLVMModuleRef M, const char *Name, LLVMValueRef Val)
 
const char * LLVMGetDebugLocDirectory (LLVMValueRef Val, unsigned *Length)
 
const char * LLVMGetDebugLocFilename (LLVMValueRef Val, unsigned *Length)
 
unsigned LLVMGetDebugLocLine (LLVMValueRef Val)
 
unsigned LLVMGetDebugLocColumn (LLVMValueRef Val)
 
LLVMValueRef LLVMAddFunction (LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
 
LLVMValueRef LLVMGetNamedFunction (LLVMModuleRef M, const char *Name)
 
LLVMValueRef LLVMGetFirstFunction (LLVMModuleRef M)
 
LLVMValueRef LLVMGetLastFunction (LLVMModuleRef M)
 
LLVMValueRef LLVMGetNextFunction (LLVMValueRef Fn)
 
LLVMValueRef LLVMGetPreviousFunction (LLVMValueRef Fn)
 
void LLVMSetModuleInlineAsm (LLVMModuleRef M, const char *Asm)
 

Detailed Description

Modules represent the top-level structure in an LLVM program. An LLVM module is effectively a translation unit or a collection of translation units merged together.

Function Documentation

◆ LLVMAddFunction()

LLVMValueRef LLVMAddFunction ( LLVMModuleRef  M,
const char *  Name,
LLVMTypeRef  FunctionTy 
)

Add a function to a module under a specified name.

See also
llvm::Function::Create()
Here is the caller graph for this function:

◆ LLVMAddModuleFlag()

void LLVMAddModuleFlag ( LLVMModuleRef  M,
LLVMModuleFlagBehavior  Behavior,
const char *  Key,
size_t  KeyLen,
LLVMMetadataRef  Val 
)

Add a module-level flag to the module-level flags metadata if it doesn't already exist.

See also
Module::addModuleFlag()

◆ LLVMAddNamedMetadataOperand()

void LLVMAddNamedMetadataOperand ( LLVMModuleRef  M,
const char *  Name,
LLVMValueRef  Val 
)

Add an operand to named metadata.

See also
llvm::Module::getNamedMetadata()
llvm::MDNode::addOperand()

◆ LLVMAppendModuleInlineAsm()

void LLVMAppendModuleInlineAsm ( LLVMModuleRef  M,
const char *  Asm,
size_t  Len 
)

Append inline assembly to a module.

See also
Module::appendModuleInlineAsm()

◆ LLVMCloneModule()

LLVMModuleRef LLVMCloneModule ( LLVMModuleRef  M)

Return an exact copy of the specified module.

◆ LLVMCopyModuleFlagsMetadata()

LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata ( LLVMModuleRef  M,
size_t *  Len 
)

Returns the module flags as an array of flag-key-value triples. The caller is responsible for freeing this array by calling LLVMDisposeModuleFlagsMetadata.

See also
Module::getModuleFlagsMetadata()

◆ LLVMDisposeModule()

void LLVMDisposeModule ( LLVMModuleRef  M)

Destroy a module instance.

This must be called for every created module or memory will be leaked.

Here is the caller graph for this function:

◆ LLVMDisposeModuleFlagsMetadata()

void LLVMDisposeModuleFlagsMetadata ( LLVMModuleFlagEntry Entries)

Destroys module flags metadata entries.

◆ LLVMDumpModule()

void LLVMDumpModule ( LLVMModuleRef  M)

Dump a representation of a module to stderr.

See also
Module::dump()

◆ LLVMGetDataLayout()

const char * LLVMGetDataLayout ( LLVMModuleRef  M)

◆ LLVMGetDataLayoutStr()

const char * LLVMGetDataLayoutStr ( LLVMModuleRef  M)

Obtain the data layout for a module.

See also
Module::getDataLayoutStr()

LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect, but match the name of another method on the module. Prefer the use of LLVMGetDataLayoutStr, which is not ambiguous.

◆ LLVMGetDebugLocColumn()

unsigned LLVMGetDebugLocColumn ( LLVMValueRef  Val)

Return the column number of the debug location for this value, which must be an llvm::Instruction.

See also
llvm::Instruction::getDebugLoc()

◆ LLVMGetDebugLocDirectory()

const char * LLVMGetDebugLocDirectory ( LLVMValueRef  Val,
unsigned *  Length 
)

Return the directory of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

See also
llvm::Instruction::getDebugLoc()
llvm::GlobalVariable::getDebugInfo()
llvm::Function::getSubprogram()

◆ LLVMGetDebugLocFilename()

const char * LLVMGetDebugLocFilename ( LLVMValueRef  Val,
unsigned *  Length 
)

Return the filename of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

See also
llvm::Instruction::getDebugLoc()
llvm::GlobalVariable::getDebugInfo()
llvm::Function::getSubprogram()

◆ LLVMGetDebugLocLine()

unsigned LLVMGetDebugLocLine ( LLVMValueRef  Val)

Return the line number of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

See also
llvm::Instruction::getDebugLoc()
llvm::GlobalVariable::getDebugInfo()
llvm::Function::getSubprogram()

◆ LLVMGetFirstFunction()

LLVMValueRef LLVMGetFirstFunction ( LLVMModuleRef  M)

Obtain an iterator to the first Function in a Module.

See also
llvm::Module::begin()

◆ LLVMGetFirstNamedMetadata()

LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata ( LLVMModuleRef  M)

Obtain an iterator to the first NamedMDNode in a Module.

See also
llvm::Module::named_metadata_begin()

◆ LLVMGetInlineAsm()

LLVMValueRef LLVMGetInlineAsm ( LLVMTypeRef  Ty,
const char *  AsmString,
size_t  AsmStringSize,
const char *  Constraints,
size_t  ConstraintsSize,
LLVMBool  HasSideEffects,
LLVMBool  IsAlignStack,
LLVMInlineAsmDialect  Dialect,
LLVMBool  CanThrow 
)

Create the specified uniqued inline asm string.

See also
InlineAsm::get()

◆ LLVMGetInlineAsmAsmString()

const char * LLVMGetInlineAsmAsmString ( LLVMValueRef  InlineAsmVal,
size_t *  Len 
)

Get the template string used for an inline assembly snippet

◆ LLVMGetInlineAsmCanUnwind()

LLVMBool LLVMGetInlineAsmCanUnwind ( LLVMValueRef  InlineAsmVal)

Get if the inline asm snippet may unwind the stack

◆ LLVMGetInlineAsmConstraintString()

const char * LLVMGetInlineAsmConstraintString ( LLVMValueRef  InlineAsmVal,
size_t *  Len 
)

Get the raw constraint string for an inline assembly snippet

◆ LLVMGetInlineAsmDialect()

LLVMInlineAsmDialect LLVMGetInlineAsmDialect ( LLVMValueRef  InlineAsmVal)

Get the dialect used by the inline asm snippet

◆ LLVMGetInlineAsmFunctionType()

LLVMTypeRef LLVMGetInlineAsmFunctionType ( LLVMValueRef  InlineAsmVal)

Get the function type of the inline assembly snippet. The same type that was passed into LLVMGetInlineAsm originally

See also
LLVMGetInlineAsm

◆ LLVMGetInlineAsmHasSideEffects()

LLVMBool LLVMGetInlineAsmHasSideEffects ( LLVMValueRef  InlineAsmVal)

Get if the inline asm snippet has side effects

◆ LLVMGetInlineAsmNeedsAlignedStack()

LLVMBool LLVMGetInlineAsmNeedsAlignedStack ( LLVMValueRef  InlineAsmVal)

Get if the inline asm snippet needs an aligned stack

◆ LLVMGetLastFunction()

LLVMValueRef LLVMGetLastFunction ( LLVMModuleRef  M)

Obtain an iterator to the last Function in a Module.

See also
llvm::Module::end()

◆ LLVMGetLastNamedMetadata()

LLVMNamedMDNodeRef LLVMGetLastNamedMetadata ( LLVMModuleRef  M)

Obtain an iterator to the last NamedMDNode in a Module.

See also
llvm::Module::named_metadata_end()

◆ LLVMGetModuleContext()

LLVMContextRef LLVMGetModuleContext ( LLVMModuleRef  M)

Obtain the context to which this module is associated.

See also
Module::getContext()

◆ LLVMGetModuleFlag()

LLVMMetadataRef LLVMGetModuleFlag ( LLVMModuleRef  M,
const char *  Key,
size_t  KeyLen 
)

Add a module-level flag to the module-level flags metadata if it doesn't already exist.

See also
Module::getModuleFlag()

◆ LLVMGetModuleIdentifier()

const char * LLVMGetModuleIdentifier ( LLVMModuleRef  M,
size_t *  Len 
)

Obtain the identifier of a module.

Parameters
MModule to obtain identifier of
LenOut parameter which holds the length of the returned string.
Returns
The identifier of M.
See also
Module::getModuleIdentifier()

◆ LLVMGetModuleInlineAsm()

const char * LLVMGetModuleInlineAsm ( LLVMModuleRef  M,
size_t *  Len 
)

Get inline assembly for a module.

See also
Module::getModuleInlineAsm()

◆ LLVMGetNamedFunction()

LLVMValueRef LLVMGetNamedFunction ( LLVMModuleRef  M,
const char *  Name 
)

Obtain a Function value from a Module by its name.

The returned value corresponds to a llvm::Function value.

See also
llvm::Module::getFunction()

◆ LLVMGetNamedMetadata()

LLVMNamedMDNodeRef LLVMGetNamedMetadata ( LLVMModuleRef  M,
const char *  Name,
size_t  NameLen 
)

Retrieve a NamedMDNode with the given name, returning NULL if no such node exists.

See also
llvm::Module::getNamedMetadata()

◆ LLVMGetNamedMetadataName()

const char * LLVMGetNamedMetadataName ( LLVMNamedMDNodeRef  NamedMD,
size_t *  NameLen 
)

Retrieve the name of a NamedMDNode.

See also
llvm::NamedMDNode::getName()

◆ LLVMGetNamedMetadataNumOperands()

unsigned LLVMGetNamedMetadataNumOperands ( LLVMModuleRef  M,
const char *  Name 
)

Obtain the number of operands for named metadata in a module.

See also
llvm::Module::getNamedMetadata()

◆ LLVMGetNamedMetadataOperands()

void LLVMGetNamedMetadataOperands ( LLVMModuleRef  M,
const char *  Name,
LLVMValueRef Dest 
)

Obtain the named metadata operands for a module.

The passed LLVMValueRef pointer should refer to an array of LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This array will be populated with the LLVMValueRef instances. Each instance corresponds to a llvm::MDNode.

See also
llvm::Module::getNamedMetadata()
llvm::MDNode::getOperand()

◆ LLVMGetNextFunction()

LLVMValueRef LLVMGetNextFunction ( LLVMValueRef  Fn)

Advance a Function iterator to the next Function.

Returns NULL if the iterator was already at the end and there are no more functions.

◆ LLVMGetNextNamedMetadata()

LLVMNamedMDNodeRef LLVMGetNextNamedMetadata ( LLVMNamedMDNodeRef  NamedMDNode)

Advance a NamedMDNode iterator to the next NamedMDNode.

Returns NULL if the iterator was already at the end and there are no more named metadata nodes.

◆ LLVMGetOrInsertNamedMetadata()

LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata ( LLVMModuleRef  M,
const char *  Name,
size_t  NameLen 
)

Retrieve a NamedMDNode with the given name, creating a new node if no such node exists.

See also
llvm::Module::getOrInsertNamedMetadata()

◆ LLVMGetPreviousFunction()

LLVMValueRef LLVMGetPreviousFunction ( LLVMValueRef  Fn)

Decrement a Function iterator to the previous Function.

Returns NULL if the iterator was already at the beginning and there are no previous functions.

◆ LLVMGetPreviousNamedMetadata()

LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata ( LLVMNamedMDNodeRef  NamedMDNode)

Decrement a NamedMDNode iterator to the previous NamedMDNode.

Returns NULL if the iterator was already at the beginning and there are no previous named metadata nodes.

◆ LLVMGetSourceFileName()

const char * LLVMGetSourceFileName ( LLVMModuleRef  M,
size_t *  Len 
)

Obtain the module's original source file name.

Parameters
MModule to obtain the name of
LenOut parameter which holds the length of the returned string
Returns
The original source file name of M
See also
Module::getSourceFileName()

◆ LLVMGetTarget()

const char * LLVMGetTarget ( LLVMModuleRef  M)

Obtain the target triple for a module.

See also
Module::getTargetTriple()

◆ LLVMGetTypeByName()

LLVMTypeRef LLVMGetTypeByName ( LLVMModuleRef  M,
const char *  Name 
)

Deprecated: Use LLVMGetTypeByName2 instead.

◆ LLVMModuleCreateWithName()

LLVMModuleRef LLVMModuleCreateWithName ( const char *  ModuleID)

Create a new, empty module in the global context.

This is equivalent to calling LLVMModuleCreateWithNameInContext with LLVMGetGlobalContext() as the context parameter.

Every invocation should be paired with LLVMDisposeModule() or memory will be leaked.

◆ LLVMModuleCreateWithNameInContext()

LLVMModuleRef LLVMModuleCreateWithNameInContext ( const char *  ModuleID,
LLVMContextRef  C 
)

Create a new, empty module in a specific context.

Every invocation should be paired with LLVMDisposeModule() or memory will be leaked.

Here is the caller graph for this function:

◆ LLVMModuleFlagEntriesGetFlagBehavior()

LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior ( LLVMModuleFlagEntry Entries,
unsigned  Index 
)

Returns the flag behavior for a module flag entry at a specific index.

See also
Module::ModuleFlagEntry::Behavior

◆ LLVMModuleFlagEntriesGetKey()

const char * LLVMModuleFlagEntriesGetKey ( LLVMModuleFlagEntry Entries,
unsigned  Index,
size_t *  Len 
)

Returns the key for a module flag entry at a specific index.

See also
Module::ModuleFlagEntry::Key

◆ LLVMModuleFlagEntriesGetMetadata()

LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata ( LLVMModuleFlagEntry Entries,
unsigned  Index 
)

Returns the metadata for a module flag entry at a specific index.

See also
Module::ModuleFlagEntry::Val

◆ LLVMPrintModuleToFile()

LLVMBool LLVMPrintModuleToFile ( LLVMModuleRef  M,
const char *  Filename,
char **  ErrorMessage 
)

Print a representation of a module to a file. The ErrorMessage needs to be disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.

See also
Module::print()

◆ LLVMPrintModuleToString()

char * LLVMPrintModuleToString ( LLVMModuleRef  M)

Return a string representation of the module. Use LLVMDisposeMessage to free the string.

See also
Module::print()
Here is the caller graph for this function:

◆ LLVMSetDataLayout()

void LLVMSetDataLayout ( LLVMModuleRef  M,
const char *  DataLayoutStr 
)

Set the data layout for a module.

See also
Module::setDataLayout()

◆ LLVMSetModuleIdentifier()

void LLVMSetModuleIdentifier ( LLVMModuleRef  M,
const char *  Ident,
size_t  Len 
)

Set the identifier of a module to a string Ident with length Len.

Parameters
MThe module to set identifier
IdentThe string to set M's identifier to
LenLength of Ident
See also
Module::setModuleIdentifier()

◆ LLVMSetModuleInlineAsm()

void LLVMSetModuleInlineAsm ( LLVMModuleRef  M,
const char *  Asm 
)

Deprecated: Use LLVMSetModuleInlineAsm2 instead.

◆ LLVMSetModuleInlineAsm2()

void LLVMSetModuleInlineAsm2 ( LLVMModuleRef  M,
const char *  Asm,
size_t  Len 
)

Set inline assembly for a module.

See also
Module::setModuleInlineAsm()

◆ LLVMSetSourceFileName()

void LLVMSetSourceFileName ( LLVMModuleRef  M,
const char *  Name,
size_t  Len 
)

Set the original source file name of a module to a string Name with length Len.

Parameters
MThe module to set the source file name of
NameThe string to set M's source file name to
LenLength of Name
See also
Module::setSourceFileName()

◆ LLVMSetTarget()

void LLVMSetTarget ( LLVMModuleRef  M,
const char *  Triple 
)

Set the target triple for a module.

See also
Module::setTargetTriple()
Here is the caller graph for this function: