about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2017-02-10 19:29:39 +0200
committerSimonas Kazlauskas <git@kazlauskas.me>2017-02-10 19:47:09 +0200
commitf3bd7231015706bee72846a758e1234febaaa60a (patch)
tree9a3072e5e71a3f79a1f2fe0a986e446387626e15 /src/rustllvm/RustWrapper.cpp
parent7d1f36a482fed39ea5989bf971464622b8cba89e (diff)
downloadrust-f3bd7231015706bee72846a758e1234febaaa60a.tar.gz
rust-f3bd7231015706bee72846a758e1234febaaa60a.zip
Fix intcast, use it where appropriate
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 27233a8b075..c15a0c3d25a 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1308,6 +1308,12 @@ extern "C" LLVMRustVisibility LLVMRustGetVisibility(LLVMValueRef V) {
   return toRust(LLVMGetVisibility(V));
 }
 
+// Oh hey, a binding that makes sense for once? (because LLVM’s own do not)
+extern "C" LLVMValueRef LLVMRustBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val,
+                                             LLVMTypeRef DestTy, bool isSigned) {
+  return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), isSigned, ""));
+}
+
 extern "C" void LLVMRustSetVisibility(LLVMValueRef V,
                                       LLVMRustVisibility RustVisibility) {
   LLVMSetVisibility(V, fromRust(RustVisibility));