diff options
author | Duncan Sands <baldrick@free.fr> | 2013-02-17 16:35:51 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2013-02-17 16:35:51 +0000 |
commit | 1cba0a8e0aea9758a066bb8802020ee8f6502b06 (patch) | |
tree | a908b89c3e7df0dd70db09a371074008818ac4d0 /llvm/lib/IR/Core.cpp | |
parent | 76e65e45425a63f8915a389a7a385cac3aae52bf (diff) | |
download | bcm5719-llvm-1cba0a8e0aea9758a066bb8802020ee8f6502b06.tar.gz bcm5719-llvm-1cba0a8e0aea9758a066bb8802020ee8f6502b06.zip |
Add multithreading functions and shutdown to the C API. Patch by Moritz
Maxeiner.
llvm-svn: 175398
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 79eb269206f..983b49c628b 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -26,9 +26,11 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" +#include "llvm/Support/Threading.h" #include <cassert> #include <cstdlib> #include <cstring> @@ -48,6 +50,10 @@ void LLVMInitializeCore(LLVMPassRegistryRef R) { initializeCore(*unwrap(R)); } +void LLVMShutdown() { + llvm_shutdown(); +} + /*===-- Error handling ----------------------------------------------------===*/ void LLVMDisposeMessage(char *Message) { @@ -2436,3 +2442,17 @@ LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) { void LLVMDisposePassManager(LLVMPassManagerRef PM) { delete unwrap(PM); } + +/*===-- Threading ------------------------------------------------------===*/ + +LLVMBool LLVMStartMultithreaded() { + return llvm_start_multithreaded(); +} + +void LLVMStopMultithreaded() { + llvm_stop_multithreaded(); +} + +LLVMBool LLVMIsMultithreaded() { + return llvm_is_multithreaded(); +} |