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 da3cbdd..a68428d 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;
 }