LLVM  3.7.0
Typedefs | Functions
Contexts

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

Collaboration diagram for Contexts:

Typedefs

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

Functions

LLVMContextRef LLVMContextCreate (void)
 Create a new context. More...
 
LLVMContextRef LLVMGetGlobalContext (void)
 Obtain the global context instance. More...
 
void LLVMContextSetDiagnosticHandler (LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
 Set the diagnostic handler for this context. More...
 
void LLVMContextSetYieldCallback (LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
 Set the yield callback function for this context. More...
 
void LLVMContextDispose (LLVMContextRef C)
 Destroy a context instance. More...
 
char * LLVMGetDiagInfoDescription (LLVMDiagnosticInfoRef DI)
 Return a string representation of the DiagnosticInfo. More...
 
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity (LLVMDiagnosticInfoRef DI)
 Return an enum LLVMDiagnosticSeverity. More...
 
unsigned LLVMGetMDKindIDInContext (LLVMContextRef C, const char *Name, unsigned SLen)
 
unsigned LLVMGetMDKindID (const char *Name, unsigned SLen)
 

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

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

Definition at line 473 of file Core.h.

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

Definition at line 474 of file Core.h.

Function Documentation

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.

Definition at line 76 of file Core.cpp.

References llvm::wrap().

void LLVMContextDispose ( LLVMContextRef  C)

Destroy a context instance.

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

Definition at line 99 of file Core.cpp.

References llvm::unwrap().

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

Set the diagnostic handler for this context.

Definition at line 84 of file Core.cpp.

References LLVM_EXTENSION, and llvm::unwrap().

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

Set the yield callback function for this context.

See Also
LLVMContext::setYieldCallback()

Definition at line 92 of file Core.cpp.

References LLVM_EXTENSION, and llvm::unwrap().

char* LLVMGetDiagInfoDescription ( LLVMDiagnosticInfoRef  DI)

Return a string representation of the DiagnosticInfo.

Use LLVMDisposeMessage to free the string.

See Also
DiagnosticInfo::print()

Definition at line 112 of file Core.cpp.

References llvm::raw_ostream::flush(), LLVMCreateMessage(), and llvm::unwrap().

LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity ( LLVMDiagnosticInfoRef  DI)

Return an enum LLVMDiagnosticSeverity.

See Also
DiagnosticInfo::getSeverity()

Definition at line 123 of file Core.cpp.

References llvm::DS_Note, llvm::DS_Remark, llvm::DS_Warning, LLVMDSError, LLVMDSNote, LLVMDSRemark, LLVMDSWarning, and llvm::unwrap().

LLVMContextRef LLVMGetGlobalContext ( void  )
unsigned LLVMGetMDKindID ( const char *  Name,
unsigned  SLen 
)

Definition at line 108 of file Core.cpp.

References LLVMGetGlobalContext(), and LLVMGetMDKindIDInContext().

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

Definition at line 103 of file Core.cpp.

References llvm::unwrap().

Referenced by LLVMGetMDKindID().