about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2015-03-04 00:57:44 +0200
committerSimonas Kazlauskas <git@kazlauskas.me>2015-04-03 15:48:07 +0300
commitdeb097a1d252d3681d790db56cd44080bb34a6bd (patch)
tree78a86a7bb2b787c9b2ae25afd14ddd9ceba14882 /src/rustllvm/RustWrapper.cpp
parentcb4570311bda1789761a98997bbe57ac6c794101 (diff)
downloadrust-deb097a1d252d3681d790db56cd44080bb34a6bd.tar.gz
rust-deb097a1d252d3681d790db56cd44080bb34a6bd.zip
Implement LLVMGetOrInsertGlobal wrapper
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index ccdc3566c09..31f75ae03b0 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -89,6 +89,12 @@ extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,
                                              unwrap<FunctionType>(FunctionTy)));
 }
 
+extern "C" LLVMValueRef LLVMGetOrInsertGlobal(LLVMModuleRef M,
+                                              const char* Name,
+                                              LLVMTypeRef Ty) {
+  return wrap(unwrap(M)->getOrInsertGlobal(Name, unwrap(Ty)));
+}
+
 extern "C" LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) {
   return wrap(Type::getMetadataTy(*unwrap(C)));
 }