-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoTailCall option #3732
Comments
To avoid proliferation of const Maybe = enum {
Default,
Always,
Never,
};
@call(comptime options: struct {
tailCall: Maybe = .Default,
inlineCall: Maybe = .Default,
newStack: ?[]align(target_stack_align) u8 = null,
}, function: var, args: ...); |
perhaps |
Your code example is missing the handle to the function itself, and if we are getting rid of var args (#208) then the const result = @call(myFunc, .{ .tailCall = false }, .{ false, 1, "three" }); |
How about just 1 argument? @call(.{
.tailCall = false,
.func = myFunc,
.args = .{ false, 1, "three" })
}); |
I think this looks harder to use. Also the call type needs to be comptime known, while the function and arguments can be runtime known. |
Fixed.
Builtins don't need to follow the rest of the language like this: they aren't normal functions. see e.g. |
Originally from #2598
I just recalled something from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826
We need a way to ensure that a given call is not a tail call.
LLVM does have a
notail
optionThe text was updated successfully, but these errors were encountered: