From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id E6F483858D38; Wed, 3 Jan 2024 13:38:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6F483858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E6F483858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704289084; cv=none; b=Ll3DNoCiLdW67cTUpO12xdQnYp9a16ytUEim4mg2JpQKY/7nmNSfgla8u2vkt9bqehjsFjWtiKh+MgbpYiJ/aCyA4CpAEqr+N+s7ir4cm3PCvYVFgOvwAhlSmiIlgjKaDkr9m4xqQnUalOCKKKh1Etp5bY3L5r/M+wrsiIzwE3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704289084; c=relaxed/simple; bh=/7LILxO/5TAf2xqslfVpMues5F07qrfaJxqcLtfYt5I=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=kHMn7iSfZMi8NqLhTj0eXUIdWl1xZ5EM9iBo84Twbrx0/NGKk4w/8425o2c7Q2aIUxYdinE3xJh3ncynEYV3s4JIO+9E42HyyZXkqgy3czc9CUVjxqHcokTZeUS9GFMwDbd2dGEl+H0RzqWDPISQ4LXIZXiUQh3l/8fMHB+dnoo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-336788cb261so9392945f8f.3; Wed, 03 Jan 2024 05:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704289080; x=1704893880; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y6A1/O+wPQqzxLZSAzAaGkUlytr2C4qScqtA3OHKQpo=; b=dQEh5GoAd2vIP1e8W7s+cYtOkwYou8kLAA+wLSWOLx+IVOnZTEoQJ9+M4OIjdGbBqP k192mdt9bmHb+Lc3C4if4XunI3T0qGFADCQDwp45/NZ/kO5BAU5Zlf1VKdrF4ITY4is0 BI0t6LH2n4ssn5S27bjs/0kn69AaW8eNWR6x7DftWSNkAu7R0VXNnHinndkDuu6bjuww a0risYORGUEKdV8i/FiFqf9leVsrZJ3T8xWzrU5c96mHH6c1nTvNf1d0C2V9zutrzeZt KeZ7CKTIEf5xDpp/0Nq5KM2P6xGKom7Pl0621qyT8TS7sUxeoDskYplP8/aLGoGc8Lnh 31PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704289080; x=1704893880; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6A1/O+wPQqzxLZSAzAaGkUlytr2C4qScqtA3OHKQpo=; b=AgUTjcJy/LHPx7FvK5r2oFI1kXkL81nmdk5gwBt//igGkXHWQaAwp8HZ73WngXqMfp Omd/ZdVxbiVuxt7/dzBx2AncPcC/JgBEO/08zwjra/iR+2xGwBpn4h6+Qy5TBv7cYMaX 8g+S9XaTT0wkbCWRpYkwUrdRxLVRT3BEOYmbtkpKaZ2AZ4Wghn5S6F1tFPeUDyS2VSBh PePo8v5acUYgaXrpqHWe3yyIHdkdMFLsf6cPiFMgLj0DaKnNYGO2OBx9f9A3zXbOMh+W /NjWsO6b7w/OAeodduVBJvoW3urTkj2vLT7t1DMl5ZumNr0sqj2UVU/nspwIDvFRb3Ze /6Nw== X-Gm-Message-State: AOJu0YyTruZgG5qlP8ktAbQUbUbvYm9z3/E+8XlEiw/L5z6Xz3pcCf39 XWODw79qG3MPQweF5c7uf94ZnM8c5azXbfy9tBc= X-Google-Smtp-Source: AGHT+IGfWRAxfdQkbDff2KSe43h/NL4MgtHeojPkessOLDNavnN4E1qBc5DGOmcuu0G5CWfSbJboBK48TxQC7tCiKmA= X-Received: by 2002:adf:cd06:0:b0:337:2e15:21be with SMTP id w6-20020adfcd06000000b003372e1521bemr3450960wrm.54.1704289075539; Wed, 03 Jan 2024 05:37:55 -0800 (PST) MIME-Version: 1.0 References: <77bb82eeebe99921773538e56b6c8baba12634a7.camel@zoho.com> <159640ff4a004359945ca9e8a81f6209f17fd39e.camel@zoho.com> In-Reply-To: From: Guillaume Gomez Date: Wed, 3 Jan 2024 14:37:44 +0100 Message-ID: Subject: Re: [PATCH] Add support for function attributes and variable attributes To: Antoni Boucher Cc: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org, David Malcolm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping David. :) Le lun. 18 d=C3=A9c. 2023 =C3=A0 23:27, Guillaume Gomez a =C3=A9crit : > > Ping David. :) > > Le sam. 9 d=C3=A9c. 2023 =C3=A0 12:12, Guillaume Gomez > a =C3=A9crit : > > > > Added it. > > > > Le jeu. 7 d=C3=A9c. 2023 =C3=A0 18:13, Antoni Boucher a =C3=A9crit : > > > > > > It seems like you forgot to prefix the commit message with "libgccjit= : > > > ". > > > > > > On Thu, 2023-11-30 at 10:55 +0100, Guillaume Gomez wrote: > > > > Ping David. :) > > > > > > > > Le jeu. 23 nov. 2023 =C3=A0 22:59, Antoni Boucher a > > > > =C3=A9crit : > > > > > David: I found back the comment you made. Here it is: > > > > > > > > > > I see you have patches to add function and variable attributes= ; > > > > > I > > > > > wonder if this would be cleaner internally if there was a > > > > > recording::attribute class, rather than the std::pair currentl= y > > > > > in > > > > > use > > > > > (some attributes have int arguments rather than string, others > > > > > have > > > > > multiple args). > > > > > > > > > > I also wondered if a "gcc_jit_attribute" type could be exposed > > > > > to > > > > > the > > > > > user, e.g.: > > > > > > > > > > attr1 =3D gcc_jit_context_new_attribute (ctxt, "noreturn"); > > > > > attr2 =3D gcc_jit_context_new_attribute_with_string (ctxt, > > > > > "alias", > > > > > "__foo"); > > > > > gcc_jit_function_add_attribute (ctxt, attr1); > > > > > gcc_jit_function_add_attribute (ctxt, attr2); > > > > > > > > > > or somesuch? But I think the API you currently have is OK. > > > > > > > > > > On Thu, 2023-11-23 at 22:52 +0100, Guillaume Gomez wrote: > > > > > > Ping David. :) > > > > > > > > > > > > Le mer. 15 nov. 2023 =C3=A0 17:56, Antoni Boucher a > > > > > > =C3=A9crit : > > > > > > > > > > > > > > David: another thing I remember you mentioned when you review= ed > > > > > > > an > > > > > > > earlier version of this patch is the usage of `std::pair`. > > > > > > > I can't find where you said that, but I remember you mentione= d > > > > > > > that > > > > > > > we > > > > > > > should use a struct instead. > > > > > > > Can you please elaborate again? > > > > > > > Thanks. > > > > > > > > > > > > > > On Wed, 2023-11-15 at 17:53 +0100, Guillaume Gomez wrote: > > > > > > > > Hi, > > > > > > > > > > > > > > > > This patch adds the (incomplete) support for function and > > > > > > > > variable > > > > > > > > attributes. The added attributes are the ones we're using i= n > > > > > > > > rustc_codegen_gcc but all the groundwork is done to add mor= e > > > > > > > > (and > > > > > > > > we > > > > > > > > will very likely add more as we didn't add all the ones we > > > > > > > > use in > > > > > > > > rustc_codegen_gcc yet). > > > > > > > > > > > > > > > > The only big question with this patch is about `inline`. We > > > > > > > > currently > > > > > > > > handle it as an attribute because it is more convenient for > > > > > > > > us > > > > > > > > but is > > > > > > > > it ok or should we create a separate function to mark a > > > > > > > > function > > > > > > > > as > > > > > > > > inlined? > > > > > > > > > > > > > > > > Thanks in advance for the review. > > > > > > > > > > > > > > >