Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
return llvm::isa<llvm::Function>(llvm::unwrap(v));
#endif
}
+
+extern "C" LLVMBuilderRef
+lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
+{
+ LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
+
+ if (unsafe_fpmath) {
+ llvm::FastMathFlags flags;
+ flags.setUnsafeAlgebra();
+ llvm::unwrap(builder)->setFastMathFlags(flags);
+ }
+
+ return builder;
+}
extern bool
lp_is_function(LLVMValueRef v);
+extern LLVMBuilderRef
+lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath);
+
#ifdef __cplusplus
}
#endif