|
LLVM
7.0.0
|
Modules represent the top-level structure in an LLVM program. More...
Functions | |
| LLVMModuleRef | LLVMModuleCreateWithName (const char *ModuleID) |
| Create a new, empty module in the global context. More... | |
| LLVMModuleRef | LLVMModuleCreateWithNameInContext (const char *ModuleID, LLVMContextRef C) |
| Create a new, empty module in a specific context. More... | |
| LLVMModuleRef | LLVMCloneModule (LLVMModuleRef M) |
| Return an exact copy of the specified module. More... | |
| void | LLVMDisposeModule (LLVMModuleRef M) |
| Destroy a module instance. More... | |
| const char * | LLVMGetModuleIdentifier (LLVMModuleRef M, size_t *Len) |
| Obtain the identifier of a module. More... | |
| void | LLVMSetModuleIdentifier (LLVMModuleRef M, const char *Ident, size_t Len) |
| Set the identifier of a module to a string Ident with length Len. More... | |
| const char * | LLVMGetSourceFileName (LLVMModuleRef M, size_t *Len) |
| Obtain the module's original source file name. More... | |
| 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. More... | |
| const char * | LLVMGetDataLayoutStr (LLVMModuleRef M) |
| Obtain the data layout for a module. More... | |
| const char * | LLVMGetDataLayout (LLVMModuleRef M) |
| void | LLVMSetDataLayout (LLVMModuleRef M, const char *DataLayoutStr) |
| Set the data layout for a module. More... | |
| const char * | LLVMGetTarget (LLVMModuleRef M) |
| Obtain the target triple for a module. More... | |
| void | LLVMSetTarget (LLVMModuleRef M, const char *Triple) |
| Set the target triple for a module. More... | |
| LLVMModuleFlagEntry * | LLVMCopyModuleFlagsMetadata (LLVMModuleRef M, size_t *Len) |
| Returns the module flags as an array of flag-key-value triples. More... | |
| void | LLVMDisposeModuleFlagsMetadata (LLVMModuleFlagEntry *Entries) |
| Destroys module flags metadata entries. More... | |
| LLVMModuleFlagBehavior | LLVMModuleFlagEntriesGetFlagBehavior (LLVMModuleFlagEntry *Entries, unsigned Index) |
| Returns the flag behavior for a module flag entry at a specific index. More... | |
| const char * | LLVMModuleFlagEntriesGetKey (LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len) |
| Returns the key for a module flag entry at a specific index. More... | |
| LLVMMetadataRef | LLVMModuleFlagEntriesGetMetadata (LLVMModuleFlagEntry *Entries, unsigned Index) |
| Returns the metadata for a module flag entry at a specific index. More... | |
| 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. More... | |
| 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. More... | |
| void | LLVMDumpModule (LLVMModuleRef M) |
| Dump a representation of a module to stderr. More... | |
| LLVMBool | LLVMPrintModuleToFile (LLVMModuleRef M, const char *Filename, char **ErrorMessage) |
| Print a representation of a module to a file. More... | |
| char * | LLVMPrintModuleToString (LLVMModuleRef M) |
| Return a string representation of the module. More... | |
| const char * | LLVMGetModuleInlineAsm (LLVMModuleRef M, size_t *Len) |
| Get inline assembly for a module. More... | |
| void | LLVMSetModuleInlineAsm2 (LLVMModuleRef M, const char *Asm, size_t Len) |
| Set inline assembly for a module. More... | |
| void | LLVMAppendModuleInlineAsm (LLVMModuleRef M, const char *Asm, size_t Len) |
| Append inline assembly to a module. More... | |
| LLVMValueRef | LLVMGetInlineAsm (LLVMTypeRef Ty, char *AsmString, size_t AsmStringSize, char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect) |
| Create the specified uniqued inline asm string. More... | |
| LLVMContextRef | LLVMGetModuleContext (LLVMModuleRef M) |
| Obtain the context to which this module is associated. More... | |
| LLVMTypeRef | LLVMGetTypeByName (LLVMModuleRef M, const char *Name) |
| Obtain a Type from a module by its registered name. More... | |
| unsigned | LLVMGetNamedMetadataNumOperands (LLVMModuleRef M, const char *Name) |
| Obtain the number of operands for named metadata in a module. More... | |
| void | LLVMGetNamedMetadataOperands (LLVMModuleRef M, const char *Name, LLVMValueRef *Dest) |
| Obtain the named metadata operands for a module. More... | |
| void | LLVMAddNamedMetadataOperand (LLVMModuleRef M, const char *Name, LLVMValueRef Val) |
| Add an operand to named metadata. More... | |
| LLVMValueRef | LLVMAddFunction (LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy) |
| Add a function to a module under a specified name. More... | |
| LLVMValueRef | LLVMGetNamedFunction (LLVMModuleRef M, const char *Name) |
| Obtain a Function value from a Module by its name. More... | |
| LLVMValueRef | LLVMGetFirstFunction (LLVMModuleRef M) |
| Obtain an iterator to the first Function in a Module. More... | |
| LLVMValueRef | LLVMGetLastFunction (LLVMModuleRef M) |
| Obtain an iterator to the last Function in a Module. More... | |
| LLVMValueRef | LLVMGetNextFunction (LLVMValueRef Fn) |
| Advance a Function iterator to the next Function. More... | |
| LLVMValueRef | LLVMGetPreviousFunction (LLVMValueRef Fn) |
| Decrement a Function iterator to the previous Function. More... | |
| void | LLVMSetModuleInlineAsm (LLVMModuleRef M, const char *Asm) |
| Deprecated: Use LLVMSetModuleInlineAsm2 instead. More... | |
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.
| LLVMValueRef LLVMAddFunction | ( | LLVMModuleRef | M, |
| const char * | Name, | ||
| LLVMTypeRef | FunctionTy | ||
| ) |
Add a function to a module under a specified name.
Definition at line 2015 of file Core.cpp.
References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, llvm::unwrap(), and llvm::wrap().
| 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.
Definition at line 365 of file Core.cpp.
References map_to_llvmModFlagBehavior(), and llvm::unwrap().
| void LLVMAddNamedMetadataOperand | ( | LLVMModuleRef | M, |
| const char * | Name, | ||
| LLVMValueRef | Val | ||
| ) |
Add an operand to named metadata.
Definition at line 1098 of file Core.cpp.
References llvm::NamedMDNode::addOperand(), extractMDNode(), N, and llvm::unwrap().
| void LLVMAppendModuleInlineAsm | ( | LLVMModuleRef | M, |
| const char * | Asm, | ||
| size_t | Len | ||
| ) |
Append inline assembly to a module.
Definition at line 420 of file Core.cpp.
References llvm::unwrap().
| LLVMModuleRef LLVMCloneModule | ( | LLVMModuleRef | M | ) |
Return an exact copy of the specified module.
Definition at line 198 of file CloneModule.cpp.
References llvm::CloneModule(), llvm::release, llvm::unwrap(), and llvm::wrap().
| 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.
Definition at line 316 of file Core.cpp.
References LLVMOpaqueModuleFlagEntry::Behavior, LLVMOpaqueModuleFlagEntry::Key, LLVMOpaqueModuleFlagEntry::KeyLen, map_from_llvmModFlagBehavior(), LLVMOpaqueModuleFlagEntry::Metadata, Result, llvm::safe_malloc(), llvm::SmallVectorBase::size(), llvm::unwrap(), and llvm::wrap().
| void LLVMDisposeModule | ( | LLVMModuleRef | M | ) |
Destroy a module instance.
This must be called for every created module or memory will be leaked.
Definition at line 223 of file Core.cpp.
References llvm::unwrap().
| void LLVMDisposeModuleFlagsMetadata | ( | LLVMModuleFlagEntry * | Entries | ) |
| void LLVMDumpModule | ( | LLVMModuleRef | M | ) |
Dump a representation of a module to stderr.
Definition at line 374 of file Core.cpp.
References llvm::errs(), and llvm::unwrap().
| const char* LLVMGetDataLayout | ( | LLVMModuleRef | M | ) |
Definition at line 252 of file Core.cpp.
References LLVMGetDataLayoutStr().
| const char* LLVMGetDataLayoutStr | ( | LLVMModuleRef | M | ) |
Obtain the data layout for a module.
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.
Definition at line 248 of file Core.cpp.
References llvm::unwrap().
Referenced by LLVMGetDataLayout().
| LLVMValueRef LLVMGetFirstFunction | ( | LLVMModuleRef | M | ) |
Obtain an iterator to the first Function in a Module.
Definition at line 2025 of file Core.cpp.
References llvm::Module::begin(), llvm::Module::end(), I, llvm::Mod, llvm::unwrap(), and llvm::wrap().
| LLVMValueRef LLVMGetInlineAsm | ( | LLVMTypeRef | Ty, |
| char * | AsmString, | ||
| size_t | AsmStringSize, | ||
| char * | Constraints, | ||
| size_t | ConstraintsSize, | ||
| LLVMBool | HasSideEffects, | ||
| LLVMBool | IsAlignStack, | ||
| LLVMInlineAsmDialect | Dialect | ||
| ) |
Create the specified uniqued inline asm string.
Definition at line 430 of file Core.cpp.
References llvm::InlineAsm::AD_ATT, llvm::InlineAsm::AD_Intel, llvm::InlineAsm::get(), LLVMInlineAsmDialectATT, LLVMInlineAsmDialectIntel, and llvm::wrap().
| LLVMValueRef LLVMGetLastFunction | ( | LLVMModuleRef | M | ) |
Obtain an iterator to the last Function in a Module.
Definition at line 2033 of file Core.cpp.
References llvm::Module::begin(), llvm::Module::end(), I, llvm::Mod, llvm::unwrap(), and llvm::wrap().
| LLVMContextRef LLVMGetModuleContext | ( | LLVMModuleRef | M | ) |
Obtain the context to which this module is associated.
Definition at line 452 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| 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.
Definition at line 360 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| const char* LLVMGetModuleIdentifier | ( | LLVMModuleRef | M, |
| size_t * | Len | ||
| ) |
Obtain the identifier of a module.
| M | Module to obtain identifier of |
| Len | Out parameter which holds the length of the returned string. |
Definition at line 227 of file Core.cpp.
References llvm::unwrap().
| const char* LLVMGetModuleInlineAsm | ( | LLVMModuleRef | M, |
| size_t * | Len | ||
| ) |
Get inline assembly for a module.
Definition at line 424 of file Core.cpp.
References llvm::unwrap().
| 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.
Definition at line 2021 of file Core.cpp.
References getFunction(), llvm::unwrap(), and llvm::wrap().
| unsigned LLVMGetNamedMetadataNumOperands | ( | LLVMModuleRef | M, |
| const char * | Name | ||
| ) |
Obtain the number of operands for named metadata in a module.
Definition at line 1081 of file Core.cpp.
References N, and llvm::unwrap().
| 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.
Definition at line 1088 of file Core.cpp.
References Context, llvm::MetadataAsValue::get(), llvm::NamedMDNode::getNumOperands(), llvm::NamedMDNode::getOperand(), N, llvm::unwrap(), and llvm::wrap().
| 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.
Definition at line 2041 of file Core.cpp.
References llvm::Module::end(), llvm::GlobalValue::getParent(), I, and llvm::wrap().
| 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.
Definition at line 2049 of file Core.cpp.
References llvm::Module::begin(), llvm::GlobalValue::getParent(), I, and llvm::wrap().
| const char* LLVMGetSourceFileName | ( | LLVMModuleRef | M, |
| size_t * | Len | ||
| ) |
Obtain the module's original source file name.
| M | Module to obtain the name of |
| Len | Out parameter which holds the length of the returned string |
Definition at line 237 of file Core.cpp.
References llvm::unwrap().
| const char* LLVMGetTarget | ( | LLVMModuleRef | M | ) |
Obtain the target triple for a module.
Definition at line 261 of file Core.cpp.
References llvm::unwrap().
| LLVMTypeRef LLVMGetTypeByName | ( | LLVMModuleRef | M, |
| const char * | Name | ||
| ) |
Obtain a Type from a module by its registered name.
Definition at line 709 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| 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.
Definition at line 214 of file Core.cpp.
References llvm::wrap().
| 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.
Definition at line 218 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior | ( | LLVMModuleFlagEntry * | Entries, |
| unsigned | Index | ||
| ) |
Returns the flag behavior for a module flag entry at a specific index.
Definition at line 338 of file Core.cpp.
References LLVMOpaqueModuleFlagEntry::Behavior.
| const char* LLVMModuleFlagEntriesGetKey | ( | LLVMModuleFlagEntry * | Entries, |
| unsigned | Index, | ||
| size_t * | Len | ||
| ) |
Returns the key for a module flag entry at a specific index.
Definition at line 345 of file Core.cpp.
References LLVMOpaqueModuleFlagEntry::Key, and LLVMOpaqueModuleFlagEntry::KeyLen.
| LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata | ( | LLVMModuleFlagEntry * | Entries, |
| unsigned | Index | ||
| ) |
Returns the metadata for a module flag entry at a specific index.
Definition at line 353 of file Core.cpp.
References LLVMOpaqueModuleFlagEntry::Metadata.
| 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.
Definition at line 379 of file Core.cpp.
References llvm::raw_fd_ostream::close(), E, llvm::raw_fd_ostream::error(), llvm::sys::fs::F_Text, llvm::raw_fd_ostream::has_error(), and llvm::unwrap().
| char* LLVMPrintModuleToString | ( | LLVMModuleRef | M | ) |
Return a string representation of the module.
Use LLVMDisposeMessage to free the string.
Definition at line 401 of file Core.cpp.
References llvm::raw_ostream::flush(), and llvm::unwrap().
| void LLVMSetDataLayout | ( | LLVMModuleRef | M, |
| const char * | DataLayoutStr | ||
| ) |
Set the data layout for a module.
Definition at line 256 of file Core.cpp.
References llvm::unwrap().
| void LLVMSetModuleIdentifier | ( | LLVMModuleRef | M, |
| const char * | Ident, | ||
| size_t | Len | ||
| ) |
Set the identifier of a module to a string Ident with length Len.
| M | The module to set identifier |
| Ident | The string to set M's identifier to |
| Len | Length of Ident |
Definition at line 233 of file Core.cpp.
References llvm::unwrap().
| void LLVMSetModuleInlineAsm | ( | LLVMModuleRef | M, |
| const char * | Asm | ||
| ) |
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition at line 416 of file Core.cpp.
References llvm::unwrap().
| void LLVMSetModuleInlineAsm2 | ( | LLVMModuleRef | M, |
| const char * | Asm, | ||
| size_t | Len | ||
| ) |
Set inline assembly for a module.
Definition at line 412 of file Core.cpp.
References llvm::unwrap().
| 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.
| M | The module to set the source file name of |
| Name | The string to set M's source file name to |
| Len | Length of Name |
Definition at line 243 of file Core.cpp.
References llvm::unwrap().
| void LLVMSetTarget | ( | LLVMModuleRef | M, |
| const char * | Triple | ||
| ) |
Set the target triple for a module.
Definition at line 265 of file Core.cpp.
References llvm::unwrap().
1.8.13