summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2018-03-24 19:15:12 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2018-03-24 19:15:12 -0700
commit02b5851258c5a0db32d1c735d1c29e5e56f45ed1 (patch)
treecee07c62e88ed16fcd4f00fe0e958eff8df27de3 /src/rustllvm/RustWrapper.cpp
parentd6926ca12daa51fd786f233019ac539d1a732493 (diff)
downloadrust-02b5851258c5a0db32d1c735d1c29e5e56f45ed1.tar.gz
rust-02b5851258c5a0db32d1c735d1c29e5e56f45ed1.zip
Polyfill LLVMBuildExactUDiv
It was added 32 days after LLVM 3.9 shipped.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index a5644d6f9e2..e815d151aeb 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1492,3 +1492,11 @@ LLVMRustBuildVectorReduceFMax(LLVMBuilderRef, LLVMValueRef, bool) {
   return nullptr;
 }
 #endif
+
+#if LLVM_VERSION_LT(4, 0)
+extern "C" LLVMValueRef
+LLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS,
+                   LLVMValueRef RHS, const char *Name) {
+  return wrap(unwrap(B)->CreateExactUDiv(unwrap(LHS), unwrap(RHS), Name));
+}
+#endif