From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28668 invoked by alias); 13 Oct 2014 08:10:25 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 28643 invoked by uid 89); 13 Oct 2014 08:10:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=unavailable version=3.3.2 X-HELO: mail-wi0-f175.google.com Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 13 Oct 2014 08:10:24 +0000 Received: by mail-wi0-f175.google.com with SMTP id d1so6625051wiv.8 for ; Mon, 13 Oct 2014 01:10:21 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.126.39 with SMTP id mv7mr18923622wib.73.1413187820889; Mon, 13 Oct 2014 01:10:20 -0700 (PDT) Received: by 10.194.20.74 with HTTP; Mon, 13 Oct 2014 01:10:20 -0700 (PDT) In-Reply-To: <5438B0DD.70309@redhat.com> References: <1412973773-3942-1-git-send-email-rth@redhat.com> <1412973773-3942-4-git-send-email-rth@redhat.com> <5438B0DD.70309@redhat.com> Date: Mon, 13 Oct 2014 08:10:00 -0000 Message-ID: Subject: Re: [gofrontend-dev] Re: [PATCH 03/13] HACK! Allow the static chain to be set from C From: Richard Biener To: Richard Henderson Cc: Peter Collingbourne , Ian Lance Taylor , gcc-patches , "libffi-discuss@sourceware.org" , "gofrontend-dev@googlegroups.com" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014/txt/msg00114.txt.bz2 On Sat, Oct 11, 2014 at 6:23 AM, Richard Henderson 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~