LLVM  3.7.0
Modules | Typedefs | Functions

This modules provide an interface to libLLVMCore, which implements the LLVM intermediate representation as well as other related types and utilities. More...

Collaboration diagram for Core:

Modules

 Types and Enumerations
 
 Contexts
 Contexts are execution states for the core LLVM IR system.
 
 Modules
 Modules represent the top-level structure in an LLVM program.
 
 Types
 Types represent the type of a value.
 
 Values
 The bulk of LLVM's object model consists of values, which comprise a very rich type hierarchy.
 
 
 Basic Block
 A basic block represents a single entry single exit section of code.
 
 Instructions
 Functions in this group relate to the inspection and manipulation of individual instructions.
 

Typedefs

typedef void(* LLVMFatalErrorHandler )(const char *Reason)
 

Functions

void LLVMInitializeCore (LLVMPassRegistryRef R)
 
void LLVMShutdown (void)
 Deallocate and destroy all ManagedStatic variables. More...
 
char * LLVMCreateMessage (const char *Message)
 
void LLVMDisposeMessage (char *Message)
 
void LLVMInstallFatalErrorHandler (LLVMFatalErrorHandler Handler)
 Install a fatal error handler. More...
 
void LLVMResetFatalErrorHandler (void)
 Reset the fatal error handler. More...
 
void LLVMEnablePrettyStackTrace (void)
 Enable LLVM's built-in stack trace code. More...
 

Detailed Description

This modules provide an interface to libLLVMCore, which implements the LLVM intermediate representation as well as other related types and utilities.

LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed as base types. Despite the declared types, most of the functions provided operate only on branches of the type hierarchy. The declared parameter names are descriptive and specify which type is required. Additionally, each type hierarchy is documented along with the functions that operate upon it. For more detail, refer to LLVM's C++ code. If in doubt, refer to Core.cpp, which performs parameter downcasts in the form unwrap<RequiredType>(Param).

Many exotic languages can interoperate with C code but have a harder time with C++ due to name mangling. So in addition to C, this interface enables tools written in such languages.

Typedef Documentation

typedef void(* LLVMFatalErrorHandler)(const char *Reason)

Definition at line 437 of file Core.h.

Function Documentation

char* LLVMCreateMessage ( const char *  Message)

Definition at line 65 of file Core.cpp.

Referenced by LLVMGetDiagInfoDescription().

void LLVMDisposeMessage ( char *  Message)

Definition at line 69 of file Core.cpp.

void LLVMEnablePrettyStackTrace ( void  )

Enable LLVM's built-in stack trace code.

This intercepts the OS's crash signals and prints which component of LLVM you were in at the time if the crash.

Definition at line 157 of file PrettyStackTrace.cpp.

References llvm::EnablePrettyStackTrace().

void LLVMInitializeCore ( LLVMPassRegistryRef  R)

Definition at line 55 of file Core.cpp.

void LLVMInstallFatalErrorHandler ( LLVMFatalErrorHandler  Handler)

Install a fatal error handler.

By default, if LLVM detects a fatal error, it will call exit(1). This may not be appropriate in many contexts. For example, doing exit(1) will bypass many crash reporting/tracing system tools. This function allows you to install a callback that will be invoked prior to the call to exit(1).

Definition at line 132 of file ErrorHandling.cpp.

References bindingsErrorHandler(), llvm::install_fatal_error_handler(), and LLVM_EXTENSION.

void LLVMResetFatalErrorHandler ( void  )

Reset the fatal error handler.

This resets LLVM's fatal error handling behavior to the default.

Definition at line 137 of file ErrorHandling.cpp.

References llvm::remove_fatal_error_handler().

void LLVMShutdown ( void  )

Deallocate and destroy all ManagedStatic variables.

See Also
llvm::llvm_shutdown
ManagedStatic

Definition at line 59 of file Core.cpp.

References llvm::llvm_shutdown().