From 9eeecd2adad8c5c94348dbd1c61709fa49f65ff8 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Jan 2018 17:28:23 -0800 Subject: [PATCH] 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 --- src/rustllvm/RustWrapper.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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(unwrap(V))) { +#if LLVM_VERSION_GE(6, 0) + I->setFast(true); +#else I->setHasUnsafeAlgebra(true); +#endif } } -- 2.44.0