1
Fork 0

Change rustc_codegen_ssa's atomic_cmpxchg interface to return a pair of values

This commit is contained in:
Bernd Schmidt 2023-11-30 14:54:27 +01:00 committed by Maybe Waffle
parent 5b8bc568d2
commit 6cf6139411
4 changed files with 12 additions and 20 deletions

View file

@ -339,7 +339,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
cmp = bx.ptrtoint(cmp, bx.type_isize());
src = bx.ptrtoint(src, bx.type_isize());
}
let pair = bx.atomic_cmpxchg(
let (val, success) = bx.atomic_cmpxchg(
dst,
cmp,
src,
@ -347,8 +347,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
parse_ordering(bx, failure),
weak,
);
let val = bx.extract_value(pair, 0);
let success = bx.extract_value(pair, 1);
let val = bx.from_immediate(val);
let success = bx.from_immediate(success);

View file

@ -296,7 +296,7 @@ pub trait BuilderMethods<'a, 'tcx>:
order: AtomicOrdering,
failure_order: AtomicOrdering,
weak: bool,
) -> Self::Value;
) -> (Self::Value, Self::Value);
fn atomic_rmw(
&mut self,
op: AtomicRmwBinOp,