gallivm: limit use of setFastMathFlags to LLVM 3.8 and later
authorMarek Olšák <marek.olsak@amd.com>
Tue, 15 Nov 2016 18:56:03 +0000 (19:56 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 15 Nov 2016 19:22:28 +0000 (20:22 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index da3cbdd53c57f063c1e42e335463bb3e11b85122..a68428d5d3b1a4e4f05d2bc19d9d86b9fa6a7c83 100644 (file)
@@ -739,11 +739,13 @@ lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
 {
    LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
 
+#if HAVE_LLVM >= 0x0308
    if (unsafe_fpmath) {
       llvm::FastMathFlags flags;
       flags.setUnsafeAlgebra();
       llvm::unwrap(builder)->setFastMathFlags(flags);
    }
+#endif
 
    return builder;
 }