about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-01-22 17:28:23 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-01-24 07:18:02 -0800
commit9eeecd2adad8c5c94348dbd1c61709fa49f65ff8 (patch)
treeff0d5150f7c1f51572253122aa4c691c407e3eef /src/rustllvm/RustWrapper.cpp
parent2a7ed74d96168fe1c187fbaa0d74dc52974b6ecf (diff)
downloadrust-9eeecd2adad8c5c94348dbd1c61709fa49f65ff8.tar.gz
rust-9eeecd2adad8c5c94348dbd1c61709fa49f65ff8.zip
llvm6: Tweak fast math intrinsics
Looks like they did some refactoring of flags in the backend and this should
catch us up! The "unsafe algebra" boolean has been split into a number of
boolean flags for various operations, and this updates to use the `setFast`
function which should hopefully have the same behavior as before.

This was updated in llvm-mirror/llvm@00e900afd
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 0fe533d447b..3491e5a4aed 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -315,7 +315,11 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
 // enable fpmath flag UnsafeAlgebra
 extern "C" void LLVMRustSetHasUnsafeAlgebra(LLVMValueRef V) {
   if (auto I = dyn_cast<Instruction>(unwrap<Value>(V))) {
+#if LLVM_VERSION_GE(6, 0)
+    I->setFast(true);
+#else
     I->setHasUnsafeAlgebra(true);
+#endif
   }
 }