You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.optimization
We could have __zig_return_error take the sret parameter and populate the error value, then return void, so that it can be a tail call.
for pure errors we can pass the error code and return it, and then return it in the parent, another tail call.
Then look at the generated assembly and make sure we're doing tail calls. This is to keep the size of the code generated small for error return tracing. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing.
Reacted by Takeshi Yoneda, snjågloe, lin72h, Samuel Guyah and Max Milton
I'm curious about the reason why an implementation detail is exposed in the standard library, and the reason why the function addErrRetTraceAddr is also public.
enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.optimization
Activity
luser commentedon Mar 27, 2020
Perhaps you've already seen it, but Swift's ABI dedicates a register to error return values:
https://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md#error-register
https://github.com/apple/swift/blob/master/docs/ABI/RegisterUsage.md
LLVM has a
swifterrorattribute to support this.perillo commentedon Feb 12, 2023
Is
__zig_return_errorused in stage2?Vexu commentedon Feb 12, 2023
Self hosted uses
std.builtin.returnError.perillo commentedon Feb 14, 2023
Thanks.
I'm curious about the reason why an implementation detail is exposed in the standard library, and the reason why the function
addErrRetTraceAddris also public.