Remap ssa RealPredicate to llvm RealPredicate

to avoid relying on the discriminant of the former for FFI purposes
This commit is contained in:
Tomasz Miąsko
2021-10-12 00:00:00 +00:00
parent ffdf18d144
commit ce7713d6b4
2 changed files with 28 additions and 0 deletions

View File

@@ -828,6 +828,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
}
fn fcmp(&mut self, op: RealPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
let op = llvm::RealPredicate::from_generic(op);
unsafe { llvm::LLVMBuildFCmp(self.llbuilder, op as c_uint, lhs, rhs, UNNAMED) }
}