![]() | Context Class |
[This is preliminary documentation and is subject to change.]
Namespace: Llvm.NET
public sealed class Context : IDisposable
The Context type exposes the following members.
Name | Description | |
---|---|---|
![]() | BoolType | Get's the LLVM boolean type for this context |
![]() ![]() | CurrentContext | Current context for the current thread |
![]() | DoubleType | Get's the LLVM double precision floating point type for this context |
![]() | FloatType | Get's the LLVM single precision floating point type for this context |
![]() | HalfFloatType | Get's the LLVM half precision floating point type for this context |
![]() | Int16Type | Get's the LLVM 16 bit integer type for this context |
![]() | Int32Type | Get's the LLVM 32 bit integer type for this context |
![]() | Int64Type | Get's the LLVM 64 bit integer type for this context |
![]() | Int8Type | Get's the LLVM 8 bit integer type for this context |
![]() | IsDisposed | Flag to indicate if this instance is still valid |
![]() | Metadata | Gets an enumerable collection of all the metadata created in this context |
![]() | VoidType | Get's the LLVM void type for this context |
Name | Description | |
---|---|---|
![]() | CreateConstant(Boolean) | Creates a new ConstantInt with a bit length of 1 |
![]() | CreateConstant(Byte) | Creates a new ConstantInt with a bit length of 8 |
![]() | CreateConstant(Double) | Creates a constant floating point value for a given value |
![]() | CreateConstant(Int16) | Creates a new ConstantInt with a bit length of 16 |
![]() | CreateConstant(Int32) | Creates a new ConstantInt with a bit length of 32 |
![]() | CreateConstant(Int64) | Creates a new ConstantInt with a bit length of 64 |
![]() | CreateConstant(SByte) | Creates a new ConstantInt with a bit length of 8 |
![]() | CreateConstant(Single) | Creates a constant floating point value for a given value |
![]() | CreateConstant(UInt16) | Creates a new ConstantInt with a bit length of 16 |
![]() | CreateConstant(UInt32) | Creates a new ConstantInt with a bit length of 32 |
![]() | CreateConstant(UInt64) | Creates a new ConstantInt with a bit length of 64 |
![]() | CreateConstant(UInt32, UInt64, Boolean) | Creates a new ConstantInt with a bit length of 64 |
![]() | CreateConstant(ITypeRef, UInt64, Boolean) | Create a constant value of the specified integer type |
![]() | CreateConstantString(String) | Create a constant data string value |
![]() | CreateConstantString(String, Boolean) | Create a constant data string value |
![]() | CreateConstantStruct(Boolean, Constant) | Creates a constant structure from a set of values |
![]() | CreateConstantStruct(Boolean, IEnumerableConstant) | Creates a constant structure from a set of values |
![]() | CreateFunctionType(DebugInfoBuilder, IDebugTypeITypeRef, DIType, IDebugTypeITypeRef, DIType) | Creates a FunctionType with Debug information |
![]() | CreateFunctionType(DebugInfoBuilder, IDebugTypeITypeRef, DIType, IEnumerableIDebugTypeITypeRef, DIType) | Creates a FunctionType with Debug information |
![]() | CreateFunctionType(DebugInfoBuilder, Boolean, IDebugTypeITypeRef, DIType, IDebugTypeITypeRef, DIType) | Creates a FunctionType with Debug information |
![]() | CreateFunctionType(DebugInfoBuilder, Boolean, IDebugTypeITypeRef, DIType, IEnumerableIDebugTypeITypeRef, DIType) | Creates a FunctionType with Debug information |
![]() | CreateMetadataString | Creates a metadata string from the given string |
![]() | CreateNamedConstantStruct(IStructType, Constant) | Creates a constant instance of a specified structure type from a set of values |
![]() | CreateNamedConstantStruct(IStructType, IEnumerableConstant) | Creates a constant instance of a specified structure type from a set of values |
![]() | CreateStructType(String) | Create an empty structure type |
![]() | CreateStructType(Boolean, ITypeRef, ITypeRef) | Create an anonymous structure type (e.g. Tuple) |
![]() | CreateStructType(String, Boolean, ITypeRef) | Creates a new structure type in this Context |
![]() | Dispose | Releases all resources used by the Context |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | (Overrides ObjectFinalize.) |
![]() | GetFunctionType(ITypeRef, ITypeRef) | Get an LLVM Function type (e.g. signature) |
![]() | GetFunctionType(ITypeRef, IEnumerableITypeRef) | Get an LLVM Function type (e.g. signature) |
![]() | GetFunctionType(ITypeRef, IEnumerableITypeRef, Boolean) | Get an LLVM Function type (e.g. signature) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetIntType | Get's an LLVM integer type of arbitrary bit width |
![]() | GetPointerTypeFor | Get a type that is a pointer to a value of a given type |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
![]() | Verify | Execute a given action if the Context is or is disposed (Defined by ContextValidator.) |
![]() | VerifyAsArg(String) | Overloaded. (Defined by ContextValidator.) |
![]() | VerifyAsArg(String, String) | Overloaded. (Defined by ContextValidator.) |
![]() | VerifyOperation | Overloaded. (Defined by ContextValidator.) |
![]() | VerifyOperation(String) | Overloaded. (Defined by ContextValidator.) |
A context in LLVM is a container for interning (LLVM refers to this as "uniqueing") various types and values in the system. This allows running multiple LLVM tool transforms etc.. on different threads without causing them to collide namespaces and types even if they use the same name (e.g. module one may have a type Foo, and so does module two but they are completely distinct from each other)
LLVM Debug information is ultimately all parented to a top level DICompileUnit as the scope, and a compilation unit is bound to a NativeModule, even though, technically the types are owned by a Context. Thus to keep things simpler and help make working with debug information easier. Lllvm.NET encapsulates the native type and the debug type in separate classes that are instances of the IDebugTypeTNative, TDebug interface
![]() |
---|
It is important to be aware of the fact that a Context is not thread safe. The context itself and the object instances it owns are intended for use by a single thread only. Accessing and manipulating LLVM objects from multiple threads may lead to race conditions corrupted state and any number of other undefined issues. |