authorgravatar for adria.arrufat@gmail.comAdrià Arrufat <adria.arrufat@gmail.com> 2026-03-11 13:55:45+09:00
committergravatar for adria.arrufat@gmail.comAdrià Arrufat <adria.arrufat@gmail.com> 2026-03-11 13:55:45+09:00
loged6baf2d67c97184da5b041cb0810dafdda444a3
treec7e4ebd3ac6c9b4f7ba66b948883412f54625797
parent9d0b89aaea47068f4c1e9b9b3e274c2733cfa6ac

Sema: remove unnecessary try in zirRoundCast


1 files changed, 2 insertions(+), 2 deletions(-)

src/Sema.zig+2-2
...@@ -20859,7 +20859,7 @@ fn zirRoundCast(...@@ -20859,7 +20859,7 @@ fn zirRoundCast(
20859 };20859 };
2086020860
20861 const dest_ty = try sema.resolveDestType(block, src, extra.lhs, .remove_eu_opt, builtin_name);20861 const dest_ty = try sema.resolveDestType(block, src, extra.lhs, .remove_eu_opt, builtin_name);
20862 const operand = try sema.resolveInst(extra.rhs);20862 const operand = sema.resolveInst(extra.rhs);
20863 const operand_ty = sema.typeOf(operand);20863 const operand_ty = sema.typeOf(operand);
2086420864
20865 try sema.checkVectorizableBinaryOperands(block, operand_src, dest_ty, operand_ty, src, operand_src);20865 try sema.checkVectorizableBinaryOperands(block, operand_src, dest_ty, operand_ty, src, operand_src);
...@@ -20894,7 +20894,7 @@ fn zirRoundCast(...@@ -20894,7 +20894,7 @@ fn zirRoundCast(
20894 _ = try sema.checkIntType(block, src, dest_scalar_ty);20894 _ = try sema.checkIntType(block, src, dest_scalar_ty);
20895 try sema.checkFloatType(block, operand_src, operand_scalar_ty);20895 try sema.checkFloatType(block, operand_src, operand_scalar_ty);
2089620896
20897 if (try sema.resolveValue(operand)) |operand_val| {20897 if (sema.resolveValue(operand)) |operand_val| {
20898 const result_val = try sema.intFromFloat(block, operand_src, operand_val, operand_ty, dest_ty, mode);20898 const result_val = try sema.intFromFloat(block, operand_src, operand_val, operand_ty, dest_ty, mode);
20899 return Air.internedToRef(result_val.toIntern());20899 return Air.internedToRef(result_val.toIntern());
20900 } else if (dest_scalar_ty.zigTypeTag(zcu) == .comptime_int) {20900 } else if (dest_scalar_ty.zigTypeTag(zcu) == .comptime_int) {