On Sat, Oct 11, 2014 at 6:23 AM, Richard Henderson <r...@redhat.com> wrote: > On 10/10/2014 06:42 PM, Peter Collingbourne wrote: >> A colleague has suggested a perhaps nicer syntax: >> >> __builtin_call_chain(pointer, call) where call must be a call expression > > I like this. > > Unlike the other suggestions, it doesn't mess with the parsing of the > "regular" > part of the function call. And, depending on what point the builtin is > lowered > and applied to the AST, it might not require any parsing changes at all. > > I'll have a look at this next week. Thanks.
Does the frontend know that the call expects a static chain? If so I like Ians suggestion more: " 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. " Richard. > > r~