mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Add multithreading functions and shutdown to the C API. Patch by Moritz
Maxeiner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f79f136cc6
commit
906727dcfe
@ -358,6 +358,11 @@ typedef enum {
|
|||||||
|
|
||||||
void LLVMInitializeCore(LLVMPassRegistryRef R);
|
void LLVMInitializeCore(LLVMPassRegistryRef R);
|
||||||
|
|
||||||
|
/** Deallocate and destroy all ManagedStatic variables.
|
||||||
|
@see llvm::llvm_shutdown
|
||||||
|
@see ManagedStatic */
|
||||||
|
void LLVMShutdown();
|
||||||
|
|
||||||
|
|
||||||
/*===-- Error handling ----------------------------------------------------===*/
|
/*===-- Error handling ----------------------------------------------------===*/
|
||||||
|
|
||||||
@ -2622,6 +2627,34 @@ LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
|
|||||||
@see llvm::PassManagerBase::~PassManagerBase. */
|
@see llvm::PassManagerBase::~PassManagerBase. */
|
||||||
void LLVMDisposePassManager(LLVMPassManagerRef PM);
|
void LLVMDisposePassManager(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup LLVMCCoreThreading Threading
|
||||||
|
*
|
||||||
|
* Handle the structures needed to make LLVM safe for multithreading.
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Allocate and initialize structures needed to make LLVM safe for
|
||||||
|
multithreading. The return value indicates whether multithreaded
|
||||||
|
initialization succeeded. Must be executed in isolation from all
|
||||||
|
other LLVM api calls.
|
||||||
|
@see llvm::llvm_start_multithreaded */
|
||||||
|
LLVMBool LLVMStartMultithreaded();
|
||||||
|
|
||||||
|
/** Deallocate structures necessary to make LLVM safe for multithreading.
|
||||||
|
Must be executed in isolation from all other LLVM api calls.
|
||||||
|
@see llvm::llvm_stop_multithreaded */
|
||||||
|
void LLVMStopMultithreaded();
|
||||||
|
|
||||||
|
/** Check whether LLVM is executing in thread-safe mode or not.
|
||||||
|
@see llvm::llvm_is_multithreaded */
|
||||||
|
LLVMBool LLVMIsMultithreaded();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -26,9 +26,11 @@
|
|||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Support/system_error.h"
|
#include "llvm/Support/system_error.h"
|
||||||
|
#include "llvm/Support/Threading.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -48,6 +50,10 @@ void LLVMInitializeCore(LLVMPassRegistryRef R) {
|
|||||||
initializeCore(*unwrap(R));
|
initializeCore(*unwrap(R));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLVMShutdown() {
|
||||||
|
llvm_shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
/*===-- Error handling ----------------------------------------------------===*/
|
/*===-- Error handling ----------------------------------------------------===*/
|
||||||
|
|
||||||
void LLVMDisposeMessage(char *Message) {
|
void LLVMDisposeMessage(char *Message) {
|
||||||
@ -2436,3 +2442,17 @@ LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) {
|
|||||||
void LLVMDisposePassManager(LLVMPassManagerRef PM) {
|
void LLVMDisposePassManager(LLVMPassManagerRef PM) {
|
||||||
delete unwrap(PM);
|
delete unwrap(PM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===-- Threading ------------------------------------------------------===*/
|
||||||
|
|
||||||
|
LLVMBool LLVMStartMultithreaded() {
|
||||||
|
return llvm_start_multithreaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLVMStopMultithreaded() {
|
||||||
|
llvm_stop_multithreaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
LLVMBool LLVMIsMultithreaded() {
|
||||||
|
return llvm_is_multithreaded();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user