std.builtin: make returnError not take the error trace

It's now unnecessary to explicitly pass this, because it receives an
implicit error trace parameter anyway, so can just use
`@errorReturnTrace()`. The previous commit updated Sema to expect this
new interface. This saves an AIR instruction at all `returnError` call
sites.
This commit is contained in:
mlugg 2025-01-22 01:51:55 +00:00 committed by Jacob Young
parent 8b5c4baed8
commit 9b7b240c8e

View File

@ -1150,9 +1150,10 @@ pub const panicInactiveUnionField = Panic.inactiveUnionField;
/// To be deleted after zig1.wasm is updated.
pub const panic_messages = Panic.messages;
pub noinline fn returnError(st: *StackTrace) void {
pub noinline fn returnError() void {
@branchHint(.unlikely);
@setRuntimeSafety(false);
const st = @errorReturnTrace().?;
if (st.index < st.instruction_addresses.len)
st.instruction_addresses[st.index] = @returnAddress();
st.index += 1;