Project Alice
Loading...
Searching...
No Matches
Collaboration diagram for Contexts:

Typedefs

typedef void(* LLVMDiagnosticHandler) (LLVMDiagnosticInfoRef, void *)
 
typedef void(* LLVMYieldCallback) (LLVMContextRef, void *)
 

Functions

LLVMContextRef LLVMContextCreate (void)
 
LLVMContextRef LLVMGetGlobalContext (void)
 
void LLVMContextSetDiagnosticHandler (LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
 
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler (LLVMContextRef C)
 
void * LLVMContextGetDiagnosticContext (LLVMContextRef C)
 
void LLVMContextSetYieldCallback (LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
 
LLVMBool LLVMContextShouldDiscardValueNames (LLVMContextRef C)
 
void LLVMContextSetDiscardValueNames (LLVMContextRef C, LLVMBool Discard)
 
void LLVMContextDispose (LLVMContextRef C)
 
char * LLVMGetDiagInfoDescription (LLVMDiagnosticInfoRef DI)
 
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity (LLVMDiagnosticInfoRef DI)
 
unsigned LLVMGetMDKindIDInContext (LLVMContextRef C, const char *Name, unsigned SLen)
 
unsigned LLVMGetMDKindID (const char *Name, unsigned SLen)
 
unsigned LLVMGetEnumAttributeKindForName (const char *Name, size_t SLen)
 
unsigned LLVMGetLastEnumAttributeKind (void)
 
LLVMAttributeRef LLVMCreateEnumAttribute (LLVMContextRef C, unsigned KindID, uint64_t Val)
 
unsigned LLVMGetEnumAttributeKind (LLVMAttributeRef A)
 
uint64_t LLVMGetEnumAttributeValue (LLVMAttributeRef A)
 
LLVMAttributeRef LLVMCreateTypeAttribute (LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
 
LLVMTypeRef LLVMGetTypeAttributeValue (LLVMAttributeRef A)
 
LLVMAttributeRef LLVMCreateStringAttribute (LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
 
const char * LLVMGetStringAttributeKind (LLVMAttributeRef A, unsigned *Length)
 
const char * LLVMGetStringAttributeValue (LLVMAttributeRef A, unsigned *Length)
 
LLVMBool LLVMIsEnumAttribute (LLVMAttributeRef A)
 
LLVMBool LLVMIsStringAttribute (LLVMAttributeRef A)
 
LLVMBool LLVMIsTypeAttribute (LLVMAttributeRef A)
 
LLVMTypeRef LLVMGetTypeByName2 (LLVMContextRef C, const char *Name)
 

Detailed Description

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.

Typedef Documentation

◆ LLVMDiagnosticHandler

typedef void(* LLVMDiagnosticHandler) (LLVMDiagnosticInfoRef, void *)

Definition at line 545 of file Core.h.

◆ LLVMYieldCallback

typedef void(* LLVMYieldCallback) (LLVMContextRef, void *)

Definition at line 546 of file Core.h.

Function Documentation

◆ LLVMContextCreate()

LLVMContextRef LLVMContextCreate ( void  )

Create a new context.

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

◆ LLVMContextDispose()

void LLVMContextDispose ( LLVMContextRef  C)

Destroy a context instance.

This should be called for every call to LLVMContextCreate() or memory will be leaked.

◆ LLVMContextGetDiagnosticContext()

void * LLVMContextGetDiagnosticContext ( LLVMContextRef  C)

Get the diagnostic context of this context.

◆ LLVMContextGetDiagnosticHandler()

LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler ( LLVMContextRef  C)

Get the diagnostic handler of this context.

◆ LLVMContextSetDiagnosticHandler()

void LLVMContextSetDiagnosticHandler ( LLVMContextRef  C,
LLVMDiagnosticHandler  Handler,
void *  DiagnosticContext 
)

Set the diagnostic handler for this context.

◆ LLVMContextSetDiscardValueNames()

void LLVMContextSetDiscardValueNames ( LLVMContextRef  C,
LLVMBool  Discard 
)

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()

◆ LLVMContextSetYieldCallback()

void LLVMContextSetYieldCallback ( LLVMContextRef  C,
LLVMYieldCallback  Callback,
void *  OpaqueHandle 
)

Set the yield callback function for this context.

See also
LLVMContext::setYieldCallback()

◆ LLVMContextShouldDiscardValueNames()

LLVMBool LLVMContextShouldDiscardValueNames ( LLVMContextRef  C)

Retrieve whether the given context is set to discard all value names.

See also
LLVMContext::shouldDiscardValueNames()

◆ LLVMCreateEnumAttribute()

LLVMAttributeRef LLVMCreateEnumAttribute ( LLVMContextRef  C,
unsigned  KindID,
uint64_t  Val 
)

Create an enum attribute.

◆ LLVMCreateStringAttribute()

LLVMAttributeRef LLVMCreateStringAttribute ( LLVMContextRef  C,
const char *  K,
unsigned  KLength,
const char *  V,
unsigned  VLength 
)

Create a string attribute.

◆ LLVMCreateTypeAttribute()

LLVMAttributeRef LLVMCreateTypeAttribute ( LLVMContextRef  C,
unsigned  KindID,
LLVMTypeRef  type_ref 
)

Create a type attribute

◆ LLVMGetDiagInfoDescription()

char * LLVMGetDiagInfoDescription ( LLVMDiagnosticInfoRef  DI)

Return a string representation of the DiagnosticInfo. Use LLVMDisposeMessage to free the string.

See also
DiagnosticInfo::print()

◆ LLVMGetDiagInfoSeverity()

LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity ( LLVMDiagnosticInfoRef  DI)

Return an enum LLVMDiagnosticSeverity.

See also
DiagnosticInfo::getSeverity()

◆ LLVMGetEnumAttributeKind()

unsigned LLVMGetEnumAttributeKind ( LLVMAttributeRef  A)

Get the unique id corresponding to the enum attribute passed as argument.

◆ LLVMGetEnumAttributeKindForName()

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.

See http://llvm.org/docs/LangRef.html#parameter-attributes and http://llvm.org/docs/LangRef.html#function-attributes for the list of available attributes.

NB: Attribute names and/or id are subject to change without going through the C API deprecation cycle.

◆ LLVMGetEnumAttributeValue()

uint64_t LLVMGetEnumAttributeValue ( LLVMAttributeRef  A)

Get the enum attribute's value. 0 is returned if none exists.

◆ LLVMGetGlobalContext()

LLVMContextRef LLVMGetGlobalContext ( void  )

Obtain the global context instance.

◆ LLVMGetLastEnumAttributeKind()

unsigned LLVMGetLastEnumAttributeKind ( void  )

◆ LLVMGetMDKindID()

unsigned LLVMGetMDKindID ( const char *  Name,
unsigned  SLen 
)

◆ LLVMGetMDKindIDInContext()

unsigned LLVMGetMDKindIDInContext ( LLVMContextRef  C,
const char *  Name,
unsigned  SLen 
)

◆ LLVMGetStringAttributeKind()

const char * LLVMGetStringAttributeKind ( LLVMAttributeRef  A,
unsigned *  Length 
)

Get the string attribute's kind.

◆ LLVMGetStringAttributeValue()

const char * LLVMGetStringAttributeValue ( LLVMAttributeRef  A,
unsigned *  Length 
)

Get the string attribute's value.

◆ LLVMGetTypeAttributeValue()

LLVMTypeRef LLVMGetTypeAttributeValue ( LLVMAttributeRef  A)

Get the type attribute's value.

◆ LLVMGetTypeByName2()

LLVMTypeRef LLVMGetTypeByName2 ( LLVMContextRef  C,
const char *  Name 
)

Obtain a Type from a context by its registered name.

◆ LLVMIsEnumAttribute()

LLVMBool LLVMIsEnumAttribute ( LLVMAttributeRef  A)

Check for the different types of attributes.

◆ LLVMIsStringAttribute()

LLVMBool LLVMIsStringAttribute ( LLVMAttributeRef  A)

◆ LLVMIsTypeAttribute()

LLVMBool LLVMIsTypeAttribute ( LLVMAttributeRef  A)