From: Owen Anderson Date: Thu, 2 Jul 2009 00:16:38 +0000 (+0000) Subject: Add a C wrapper for accessing the global default context. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c70e62110b7e165ab8f04c38ffd97f905dcda95d;p=oota-llvm.git Add a C wrapper for accessing the global default context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74675 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 7019b4cc660..c022c101775 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 9f92e6f2949..f7fb1bbf7df 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); }