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
For a call signature `sig` and the IR code for it, check whether this is a Varargs call.
70
-
71
-
The need for this arises because the output of `Base.code_ircode_by_type` does not
72
-
distinguish between varargs and tuples, see https://github.com/JuliaLang/julia/issues/58753. Thus we have to go back to the signature that created the IR to check. There are two cases
73
-
that signal that this is indeed a varargs call:
74
-
1. The last argument in `sig` is a `Vararg` object.
75
-
2. The last argument of `ir` is a `Tuple` of the types of the last arguments of `sig`. For
76
-
instance `sig` may end in `Symbol, Tuple{Int, Int}` and the last argument of `ir` would be
77
-
`Tuple{Symbol, Tuple{Int, Int}}`.
78
-
79
-
That there are these two cases, and only these two cases, is not based on a good
80
-
understanding of anything, but rather on observing which cases arise in our test suite. This solution is thus a hack and should be rewritten by someone who actually understands how IR
81
-
handles `Varargs`.
82
-
"""
83
-
functioncheck_varargs(sig, ir)
84
-
sig.parameters[end] isa Core.TypeofVararg &&returntrue
85
-
(ir.argtypes[end] isa Type && ir.argtypes[end] <:Tuple) ||returnfalse
0 commit comments