Table of Contents

Class Module

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

LLVM Bitcode module

public sealed class Module : IModule, IEquatable<IModule>, IDisposable, IEquatable<Module>
Inheritance
Module
Implements
Inherited Members

Remarks

A module is the basic unit for containing code in LLVM. Modules are an in memory representation of the LLVM Intermediate Representation (IR) bit-code.

Fields

DebugVersionValue

Name of the Debug Version information module flag

DwarfVersionValue

Name of the Dwarf Version module flag

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

IsDisposed

Gets a value indicating whether this instance is already disposed

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

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Equals(object?)

Determines whether the specified object is equal to the current object.

Equals(IModule?)

Indicates whether the current object is equal to another object of the same type.

Equals(Module?)

Indicates whether the current object is equal to another object of the same type.

GetAlias(LazyEncodedString)

Get an alias by name

GetHashCode()

Serves as the default hash function.

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

LoadFrom(LazyEncodedString, IContext)

Load a bit-code module from a given file

LoadFrom(MemoryBuffer, IContext)

Load bit code from a memory buffer

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