gallivm: limit use of setFastMathFlags to LLVM 3.8 and later

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Marek Olšák 2016-11-15 19:56:03 +01:00
parent 341fc0073a
commit 5b8876609e

View 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;
}