aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm-c/Core.h1
-rw-r--r--lib/VMCore/Core.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index 7019b4cc66..c022c10177 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -195,6 +195,7 @@ void LLVMDisposeMessage(char *Message);
/* Create and destroy contexts. */
LLVMContextRef LLVMContextCreate();
+LLVMContextRef LLVMGetGlobalContext();
void LLVMContextDispose(LLVMContextRef C);
/* Create and destroy modules. */
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index 9f92e6f294..f7fb1bbf7d 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -45,6 +45,10 @@ LLVMContextRef LLVMContextCreate() {
return wrap(new LLVMContext());
}
+LLVMContextRef LLVMGetGlobalContext() {
+ return wrap(&getGlobalContext());
+}
+
void LLVMContextDispose(LLVMContextRef C) {
delete unwrap(C);
}