mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 12:27:41 +00:00
translate-c: use transCreateNodeInfixOp for pointer arithmetic
This commit is contained in:
parent
e2cc02717e
commit
55e6bd10fe
@ -1353,10 +1353,14 @@ fn transCreatePointerArithmeticSignedOp(
|
||||
|
||||
const bitcast_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node);
|
||||
|
||||
const arith_args = .{ .lhs = lhs_node, .rhs = bitcast_node };
|
||||
const arith_node = try if (is_add) Tag.add.create(c.arena, arith_args) else Tag.sub.create(c.arena, arith_args);
|
||||
|
||||
return maybeSuppressResult(c, scope, result_used, arith_node);
|
||||
return transCreateNodeInfixOp(
|
||||
c,
|
||||
scope,
|
||||
if (is_add) .add else .sub,
|
||||
lhs_node,
|
||||
bitcast_node,
|
||||
result_used,
|
||||
);
|
||||
}
|
||||
|
||||
fn transBinaryOperator(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user