aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2013-02-17 16:35:51 +0000
committerDuncan Sands <baldrick@free.fr>2013-02-17 16:35:51 +0000
commit906727dcfeb359acec4caca3ba8c756c4308ff6b (patch)
treed12c1a86c8f200929c62f116ff1c10accea1a56f /lib
parentf79f136cc64b0625b77c7b9008ed8c5b848b6b17 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/Core.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp
index 79eb269206..983b49c628 100644
--- a/lib/IR/Core.cpp
+++ b/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();
+}