From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 9B6D83858C78; Mon, 18 Dec 2023 22:27:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B6D83858C78 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 9B6D83858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702938471; cv=none; b=FMtobD1PFjoUZKiVCtI/JXrv0UOgm3M6opyTVxslzSvH27uOb0fo+eqDDY7cW2McMSCMkmBZ8dMRx7zcn9fYrBEdsNm/jG8Myumg9CsZYNAqMGKzp6vpn5RVyl1OW1F7gKfEBYUQFhhsKfw1Ab7PvGwWZ3OdiMK8Xjo34Y59M9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702938471; c=relaxed/simple; bh=PYpFav2K2oSTgM8IALr9DU2jnqgsbg4tEgAvF8R10O4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=n1l28+2y7iO+rHTtqu2/WNKNKZ6q44uUdCfvFj45i92WvEGJTsdPvz7yWPHOQFVL4oI3C5ransK+xfthXsakH2I6sZxlcoWKUzowZr2ZeSREx3+QgLbNpwRFmg5PjYO2BxuvS8JFgw9D8RUgJ3JDUYN5H6/RU/wj5/noBjpGNlA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3365b5d6f0eso2255656f8f.3; Mon, 18 Dec 2023 14:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702938468; x=1703543268; 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=BAFUy1/zOxUThWWN73AsNHzcAT7ViPiUydxKuL28ohQ=; b=k/ejJcVh69KgMYa/rT973iqECDTcPzcNgNqxcLM00abPExcIlHVRs+7UiaS6PiyaVl C71WIZUBuv+j/Zglxk9yznmg8l+3qE//cUHZ4X54HqJkSHvTruXG2xjkAlVKP1Vozf08 zECvkG80eIkJ+WhuEGJWJXCh4nWB+mWALZVoHZA+BNgDTk2AmSme9CeKzkv+6jeg90gE fA7LRra45RhFrciq9mXcvzRtgpQ3wD7x9aT+zdNN8uuhYcoBiP47niJd7FUlk+mw+QHp MMCv7Xrz4372peFArufsr6dnB7JZM3MuzQ4SZyS+C0izI9pWMLltefSMgqFrPZAK29fI /bsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702938468; x=1703543268; 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=BAFUy1/zOxUThWWN73AsNHzcAT7ViPiUydxKuL28ohQ=; b=vTl3ppgBAHk6ziRDLZnwqE7xYVsrdH4Rfd5LN7RVots92kCTUs+2T6cj09+U1Jy/q9 /AHf02grPEefIJqoDynCN1nOB31YzC6z975Y+e1/3rPgDnhZGz16iZ5/no+e2uCkh41x 8rGytJB4QcH0IrrfCC3nX42wIAa19WagvkjBPmM7SFZNDhvTExRhIdfGR5cXfxE5AGnz Zwohkw6fve0idrZ5tWVpVkwk1/oDPm51ByFJSVOHU3+MmPbM+JtZQu5dCEPFn+MYD01A +/FxFm+mnclqStK5AfVoecWOVvvcP5p5auOrCrWpkNnxW8wFtDLz4eRV06XDrv9lHrok TbnA== X-Gm-Message-State: AOJu0Yx5upQsUtsSbp5ivTW1R5H+PAjRFG32cdTyCHl2cbmODXrfGnbD tZVWFd/+CnslKfRjlCfjlQsfr7/8mopDHQIYVQQZ/D9D X-Google-Smtp-Source: AGHT+IFUL/6bm/Jx5vBh8TQE8/RMlRWdqPDfc+04RHBM4DdK2z37a50AjcfHo3+ssG5JEOBR9iyxDC59Ef2dh3XJ5qI= X-Received: by 2002:a05:6000:82:b0:336:7045:6918 with SMTP id m2-20020a056000008200b0033670456918mr205984wrx.134.1702938467664; Mon, 18 Dec 2023 14:27:47 -0800 (PST) MIME-Version: 1.0 References: <77bb82eeebe99921773538e56b6c8baba12634a7.camel@zoho.com> <159640ff4a004359945ca9e8a81f6209f17fd39e.camel@zoho.com> In-Reply-To: From: Guillaume Gomez Date: Mon, 18 Dec 2023 23:27:36 +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.6 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 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 currently > > > > 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 reviewed > > > > > > an > > > > > > earlier version of this patch is the usage of `std::pair`. > > > > > > I can't find where you said that, but I remember you mentioned > > > > > > 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 in > > > > > > > rustc_codegen_gcc but all the groundwork is done to add more > > > > > > > (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. > > > > > > > > > > > >