 | Context.CurrentContext Property |
[This is preliminary documentation and is subject to change.]
Current context for the current thread
Namespace:
Llvm.NET
Assembly:
Llvm.NET (in Llvm.NET.dll) Version: 3.8.6158
Syntaxpublic static Context CurrentContext { get; }
Property Value
Type:
Context
Remarks
While most LLVM types contain the ability to retrieve their owning
Context
it is not always possible. For example, in LLVM, an empty
AttributeSet doesn't
actually have a Context so adding attributes to an empty
AttributeSet requires
a
Context but adding attributes to a non-empty set does not. Thus, without some
other means of getting a default
Context multiple overloads for the Add operation
would need to exist. Furthermore, calling code would need to manage dealing with deciding which
variation of the overloaded methods to call at runtime. All of that and other similar cases are
eliminated by having a thread static property to access whenever a
Context instance
is required but otherwise not conveniently available.
See Also