Table of Contents

Interface IModule

Namespace
Ubiquity.NET.Llvm
Assembly
Ubiquity.NET.Llvm.dll

Interface for an LLVM bitcode module

public interface IModule : IEquatable<IModule>
Inherited Members

Remarks

This interface is used for ALL modules owned/unowned when a module is owned and the app must dispose it a Module instance is provided. That type implements this interface AND the standard IDisposable interface as the caller is responsible for disposal of the instance. When this interface is returned the caller does not own the implementation and cannot dispose of it. (Generally only methods that act as a factory for a module will provide a concrete Module instance that the caller owns. Others are references to a module owned by the container)

Properties

Aliases

Gets the global aliases in this module

Comdats

Gets the Comdats for this module

CompileUnits

Gets the Debug Compile units for this module

Context

Gets the Context this module belongs to

DataLayoutString

Gets or Sets the Data layout string for this module

DebugMetadataVersion

Gets the Debug metadata version that is present in this module

Functions

Gets the functions contained in this module

Globals

Gets the GlobalVariables contained by this module

IndirectFunctions

Gets the GlobalIFuncs in this module

Layout

Gets or sets the target data layout for this module

ModuleFlags

Gets the IrMetadata for module level flags

ModuleInlineAsm

Gets or sets the module level inline assembly

Name

Gets the name of the module

NamedMetadata

Gets the NamedMDNodes for this module

SourceFileName

Gets or sets the name of the source file generating this module

TargetTriple

Gets or sets the Target Triple describing the target, ABI and OS

Methods

AddAlias(Value, LazyEncodedString, uint)

Add an alias to the module

AddGlobal(ITypeRef, bool, Linkage, Constant)

Adds a global to this module

AddGlobal(ITypeRef, bool, Linkage, Constant, LazyEncodedString)

Adds a global to this module

AddGlobal(ITypeRef, LazyEncodedString)

Adds a global to this module

AddGlobalInAddressSpace(uint, ITypeRef, bool, Linkage, Constant)

Adds a global to this module

AddGlobalInAddressSpace(uint, ITypeRef, bool, Linkage, Constant, LazyEncodedString)

Adds a global to this module

AddGlobalInAddressSpace(uint, ITypeRef, LazyEncodedString)

Adds a global to this module with a specific address space

AddModuleFlag(ModuleFlagBehavior, LazyEncodedString, uint)

Adds a module flag to the module

AddModuleFlag(ModuleFlagBehavior, LazyEncodedString, IrMetadata)

Adds a module flag to the module

AddNamedMetadataOperand(LazyEncodedString, IrMetadata)

Adds operand value to named metadata

AddVersionIdentMetadata(LazyEncodedString)

Adds an llvm.ident metadata string to the module

AppendInlineAsm(LazyEncodedString)

Appends inline assembly to the module's inline assembly

Clone()

Clones the current module into the same context

Clone(IContext)

Clones the module into a new IContext

CreateAndAddGlobalIFunc(LazyEncodedString, ITypeRef, uint, Function)

Create and add a global indirect function

CreateFunction(LazyEncodedString, IFunctionType)

Gets an existing function with the specified signature in the module or creates a new one if it doesn't exist

CreateFunction(IDIBuilder, LazyEncodedString, bool, IDebugType<ITypeRef, DIType>, params IEnumerable<IDebugType<ITypeRef, DIType>>)

Creates a function

CreateFunction(IDIBuilder, DIScope?, LazyEncodedString, LazyEncodedString?, DIFile?, uint, DebugFunctionType, bool, bool, uint, DebugInfoFlags, bool)

Creates a Function definition with Debug information

GetAlias(LazyEncodedString)

Get an alias by name

GetIntrinsicDeclaration(uint, params ITypeRef[])

Gets a declaration for an LLVM intrinsic function

GetIntrinsicDeclaration(LazyEncodedString, params ITypeRef[])

Gets a declaration for an LLVM intrinsic function

GetNamedGlobal(LazyEncodedString)

Retrieves a named global from the module

GetTypeByName(LazyEncodedString)

Retrieves a ITypeRef by name from the module

Link(Module)

Link another module into this one

StripDebugInformation()

Strips debug information from this module

TryGetFunction(LazyEncodedString, out Function)

Looks up a function in the module by name

TryGetNamedGlobalIFunc(LazyEncodedString, out GlobalIFunc)

Get a named Global Indirect function in the module

TryRunPasses(params LazyEncodedString[])

Tries running the specified passes on this function

TryRunPasses(PassBuilderOptions, params LazyEncodedString[])

Tries running the specified passes on this function

TryRunPasses(TargetMachine, PassBuilderOptions, params LazyEncodedString[])

Tries running the specified passes on this function

Verify(out string)

Verifies a bit-code module

WriteToBuffer()

Writes the LLVM IR bit code into a memory buffer

WriteToFile(string)

Writes a bit-code module to a file

WriteToString()

Creates a string representation of the module

WriteToTextFile(string, out string)

Writes this module as LLVM IR source to a file