LLVM: Contexts (original) (raw)

Contexts are execution states for the core LLVM IR system. More...

Functions
LLVM_C_ABI LLVMContextRef LLVMContextCreate (void)
Create a new context.
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED (LLVMContextRef LLVMGetGlobalContext(void), "Use of the global context is deprecated, create " "one using LLVMContextCreate instead")
Obtain the global context instance.
LLVM_C_ABI void LLVMContextSetDiagnosticHandler (LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
LLVM_C_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler (LLVMContextRef C)
Get the diagnostic handler of this context.
LLVM_C_ABI void * LLVMContextGetDiagnosticContext (LLVMContextRef C)
Get the diagnostic context of this context.
LLVM_C_ABI void LLVMContextSetYieldCallback (LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
LLVM_C_ABI LLVMBool LLVMContextShouldDiscardValueNames (LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
LLVM_C_ABI void LLVMContextSetDiscardValueNames (LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
LLVM_C_ABI void LLVMContextDispose (LLVMContextRef C)
Destroy a context instance.
LLVM_C_ABI char * LLVMGetDiagInfoDescription (LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
LLVM_C_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity (LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
LLVM_C_ABI unsigned LLVMGetMDKindIDInContext (LLVMContextRef C, const char *Name, unsigned SLen)
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED (unsigned LLVMGetMDKindID(const char *Name, unsigned SLen), "Use of the global context is deprecated, use LLVMGetMDKindIDInContext " "instead")
LLVM_C_ABI unsigned LLVMGetSyncScopeID (LLVMContextRef C, const char *Name, size_t SLen)
Maps a synchronization scope name to a ID unique within this context.
LLVM_C_ABI unsigned LLVMGetEnumAttributeKindForName (const char *Name, size_t SLen)
Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists.
LLVM_C_ABI unsigned LLVMGetLastEnumAttributeKind (void)
LLVM_C_ABI LLVMAttributeRef LLVMCreateEnumAttribute (LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
LLVM_C_ABI unsigned LLVMGetEnumAttributeKind (LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
LLVM_C_ABI uint64_t LLVMGetEnumAttributeValue (LLVMAttributeRef A)
Get the enum attribute's value.
LLVM_C_ABI LLVMAttributeRef LLVMCreateTypeAttribute (LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
LLVM_C_ABI LLVMTypeRef LLVMGetTypeAttributeValue (LLVMAttributeRef A)
Get the type attribute's value.
LLVM_C_ABI LLVMAttributeRef LLVMCreateConstantRangeAttribute (LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
LLVM_C_ABI LLVMAttributeRef LLVMCreateStringAttribute (LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
LLVM_C_ABI const char * LLVMGetStringAttributeKind (LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
LLVM_C_ABI const char * LLVMGetStringAttributeValue (LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
LLVM_C_ABI LLVMBool LLVMIsEnumAttribute (LLVMAttributeRef A)
Check for the different types of attributes.
LLVM_C_ABI LLVMBool LLVMIsStringAttribute (LLVMAttributeRef A)
LLVM_C_ABI LLVMBool LLVMIsTypeAttribute (LLVMAttributeRef A)
LLVM_C_ABI LLVMTypeRef LLVMGetTypeByName2 (LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.

Contexts are execution states for the core LLVM IR system.

Most types are tied to a context instance. Multiple contexts can exist simultaneously. A single context is not thread safe. However, different contexts can execute on different threads simultaneously.

LLVMDiagnosticHandler

LLVMYieldCallback

LLVM_ATTRIBUTE_C_DEPRECATED() [1/2]

LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED ( LLVMContextRef _LLVMGetGlobalContext_void,
"Use of the global context is deprecated,
create " "one using LLVMContextCreate instead" )

Obtain the global context instance.

References C(), and LLVM_C_ABI.

LLVM_ATTRIBUTE_C_DEPRECATED() [2/2]

LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED ( unsigned _LLVMGetMDKindID_const char *Name, unsigned SLen,
"Use of the global context is deprecated,
use LLVMGetMDKindIDInContext " "instead" )

LLVMContextCreate()

Create a new context.

Every call to this function should be paired with a call to LLVMContextDispose() or the context will leak memory.

Definition at line 104 of file Core.cpp.

References llvm::wrap().

LLVMContextDispose()

LLVMContextGetDiagnosticContext()

LLVMContextGetDiagnosticHandler()

LLVMContextSetDiagnosticHandler()

LLVMContextSetDiscardValueNames()

Set whether the given context discards all value names.

If true, only the names of GlobalValue objects will be available in the IR. This can be used to save memory and runtime, especially in release mode.

See also

LLVMContext::setDiscardValueNames()

Definition at line 139 of file Core.cpp.

References llvm::CallingConv::C, and llvm::unwrap().

LLVMContextSetYieldCallback()

LLVMContextShouldDiscardValueNames()

LLVMCreateConstantRangeAttribute()

LLVMCreateEnumAttribute()

LLVMCreateStringAttribute()

LLVMCreateTypeAttribute()

LLVMGetDiagInfoDescription()

LLVMGetDiagInfoSeverity()

LLVMGetEnumAttributeKind()

LLVMGetEnumAttributeKindForName()

LLVMGetEnumAttributeValue()

LLVMGetLastEnumAttributeKind()

LLVMGetMDKindIDInContext()

LLVMGetStringAttributeKind()

LLVMGetStringAttributeValue()

LLVMGetSyncScopeID()

LLVMGetTypeAttributeValue()

LLVMGetTypeByName2()

LLVMIsEnumAttribute()

LLVMIsStringAttribute()

LLVMIsTypeAttribute()