summaryrefslogtreecommitdiff
path: root/include/llvm/IR/LLVMContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/LLVMContext.h')
-rw-r--r--include/llvm/IR/LLVMContext.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/IR/LLVMContext.h b/include/llvm/IR/LLVMContext.h
index ae81e5b1c3..f25d820c2b 100644
--- a/include/llvm/IR/LLVMContext.h
+++ b/include/llvm/IR/LLVMContext.h
@@ -15,7 +15,9 @@
#ifndef LLVM_IR_LLVMCONTEXT_H
#define LLVM_IR_LLVMCONTEXT_H
+#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/Compiler.h"
+#include "llvm-c/Core.h"
namespace llvm {
@@ -109,6 +111,19 @@ private:
/// only care about operating on a single thread.
extern LLVMContext &getGlobalContext();
+// Create wrappers for C Binding types (see CBindingWrapping.h).
+DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef)
+
+/* Specialized opaque context conversions.
+ */
+inline LLVMContext **unwrap(LLVMContextRef* Tys) {
+ return reinterpret_cast<LLVMContext**>(Tys);
+}
+
+inline LLVMContextRef *wrap(const LLVMContext **Tys) {
+ return reinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
+}
+
}
#endif