summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-01-25 12:49:01 -0600
committerAlex Crichton <alex@alexcrichton.com>2018-01-25 13:49:54 -0800
commit8a9381db01c71851654e445e7f2d81786fc80ecd (patch)
tree133465413a64b18bbe2bf90eb71bf25220dfab6d /src/rustllvm/RustWrapper.cpp
parentf7706d5816b48a9dcc31b06472ecb630eab2ea44 (diff)
parente9a64996bedbc224d1edb401162d2c3cc15eb7c1 (diff)
downloadrust-8a9381db01c71851654e445e7f2d81786fc80ecd.tar.gz
rust-8a9381db01c71851654e445e7f2d81786fc80ecd.zip
Rollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis
First round of LLVM 6.0.0 compatibility

This includes a number of commits for the first round of upgrading to LLVM 6. There are still [lingering bugs](https://github.com/rust-lang/rust/issues/47683) but I believe all of this will nonetheless be necessary!
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 82aafb7c355..611d63f6a4d 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
   }
 }