From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B13C73858421 for ; Fri, 5 Nov 2021 21:53:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B13C73858421 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-PNJmYg-SPFSKAcLppy812Q-1; Fri, 05 Nov 2021 17:53:55 -0400 X-MC-Unique: PNJmYg-SPFSKAcLppy812Q-1 Received: by mail-qk1-f197.google.com with SMTP id h2-20020a05620a10a200b00462c87635cdso8005500qkk.15 for ; Fri, 05 Nov 2021 14:53:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=4VkDLU4qFBA2COA9ppHGKdXwW6YGhEZHxDCaSgh0HL0=; b=4Zj8bUjqtvJHBvaC/M1qEJjv28Y1MxhoYeCVLh+JHfYlQmap7b95vA458XM2dgByBG CGH0+1g+En79UGgCiRpCpbNgGUZ8iLPamXC0KaxmDi6C7TvGHuQE5k3ir/ERnmAN1XiF 6oF7xMTfz+pynbfGyOwsYKpDGT8Smq2swGSjScJ2ZWLacrGZ9StmgZetGMj9Dqcsmjs+ aB4lOC0gpCXl0yiJgkJtUT8QjGhkW5qyuiCGzV8kqoQo0cGtRXZh6hGSucfabeFwZtQ4 xpiYuU+COEec7tkcepxh5NFtvsmtyvSg/6IUoKFHpKUzjrRzwkoEHn2Sqv9/QOfacK8o +jQg== X-Gm-Message-State: AOAM530q7D3iKe62DujWV9Z5hl3kjnnbCD776ZQCxX0zrjXjJS70TxsP vyjr6ZiuByKjvGXKnZAXr9dpaUQMQWvairZZRIZ0quHAOiqgss4AUl+nzI+s8uRVwf4+IUsgawJ YRIPB9UN0nIT94vsORg== X-Received: by 2002:a05:620a:ced:: with SMTP id c13mr2565588qkj.88.1636149234694; Fri, 05 Nov 2021 14:53:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIBSl1iBW5k/Hm88U/CSfAnc0ZzhfWoB/jFKqhQx/Yj1Z4kjzWXftlLLOUQlLkzOCRoJpaUw== X-Received: by 2002:a05:620a:ced:: with SMTP id c13mr2565574qkj.88.1636149234449; Fri, 05 Nov 2021 14:53:54 -0700 (PDT) Received: from [192.168.1.149] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id t4sm6360240qkp.42.2021.11.05.14.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Nov 2021 14:53:53 -0700 (PDT) Message-ID: Date: Fri, 5 Nov 2021 17:53:52 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH] coroutines, c++: Find lambda-ness from the ramp function [PR 96517]. To: Iain Sandoe Cc: gcc-patches@gcc.gnu.org References: <20211105160123.15808-1-iain@sandoe.co.uk> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2021 21:53:58 -0000 On 11/5/21 17:16, Iain Sandoe wrote: > Hi Jason, > >> On 5 Nov 2021, at 20:50, Jason Merrill via Gcc-patches wrote: >> >> On 11/5/21 12:01, Iain Sandoe wrote: >>> + || (DECL_DECLARES_FUNCTION_P (DECL_CONTEXT (decl)) >>> + && DECL_COROUTINE_P (DECL_CONTEXT (decl)) >>> + && DECL_RAMP_FN (DECL_CONTEXT (decl)) >>> + && LAMBDA_FUNCTION_P (DECL_RAMP_FN (DECL_CONTEXT (decl)))))); >> >> Are there other places that want to look through DECL_RAMP_FN like this, such that this should be factored into e.g. >> >> LAMBDA_FUNCTION_P (non_coroutine (DECL_CONTEXT (decl))) > > At present, I am not aware of another use (there are none in my WIP fixes) - but that stack of macros is a bit of a mouthful - maybe a function would be neater anyway. > > non_coroutine () doesn’t convey its meaning to me - what we are trying to say “get me the ramp context” but that’s very detailed. I figured what we want is the user-written function corresponding to the argument. Hmm, the coroutine helpers don't use DECL_ABSTRACT_ORIGIN, do they? Jason