This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 03/13] HACK! Allow the static chain to be set from C


On Fri, Oct 10, 2014 at 1:42 PM, Richard Henderson <rth@redhat.com> wrote:
>
> This is awful syntax, and therefore contains no documentation.
> But we'll need to be able to set the static chain on a few calls
> within the Go runtime, so we need to expose this by some means.
>
> It currently looks like
>
>         function(args...) __builtin_call_chain(pointer)
>
> because that was easy to parse.

How crazy would it be to move __builtin_call_chain into the function
arguments, as in
    function(a1, a2, __builtin_call_chain(pointer))
This __builtin_call_chain call would be removed from the argument list
so type checking would only look at a1, a2.  It would just set the
static chain value.  That at least puts the call_chain in the right
place, which is a special kind of function argument.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]