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.129.124]) by sourceware.org (Postfix) with ESMTPS id E40FE3858D28 for ; Tue, 20 Feb 2024 20:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E40FE3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E40FE3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708462210; cv=none; b=vW+2FSkjR6cFC8nPni+z/Nd0j9KCPMRzFhp5PswjHYTcX8TUz1S2kKWX7j8wNJyfF+kC5S0Q3gpTHJPB2bGD9mYi24LIoJl2HA2PNiag0tjq7w8S4J718UKEIEXsjZ/IqqBW2iKUqrGqxPIoJucFa6G3csim1OrMAyINoJcFmwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708462210; c=relaxed/simple; bh=GDZufjbAyJosRBxWj8QZ8MmQw7pRTvbwEtQOcuIyOhE=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=kiyXTEICoUeYLEe+DQ9tnEzj6AwvJ+i6PSe/UVQ4ixsJCFEc7SM9Mos3fK7MH/m94dP8TN2SNjVbtJ3WRnOYQvSSX6nGYO0nQX8Q2xjdSqpvBnKFA6kyjOkWSAuXt2CMooZclNBbDsIUFbju3C0C97haOHIin3950UJcmeubQuw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708462208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xaVM5NixdYzTkvwEEPyu1A/fNXMJi+fvsrj6aHUbed8=; b=h/IGbsfsmtsO7R8LNJWpJcnXe1PXudlgnDAJtSZPdQbLfFChnlRwf1cYjj0i/wK8a7hxD4 jIwNOgqPQBgBXRnqUKb3hpn6rXDeu+0ecdLr6zDZqeio4VkDcAfvzTkuU9PaQ3cp+PTlBI uZUcM+HAB55phFWZuvVV25ccqyBgo44= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-UjZKqRy6N0qi5zbKECpIOQ-1; Tue, 20 Feb 2024 15:50:06 -0500 X-MC-Unique: UjZKqRy6N0qi5zbKECpIOQ-1 Received: by mail-yb1-f198.google.com with SMTP id 3f1490d57ef6-dcbfe1a42a4so12188971276.2 for ; Tue, 20 Feb 2024 12:50:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708462206; x=1709067006; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xaVM5NixdYzTkvwEEPyu1A/fNXMJi+fvsrj6aHUbed8=; b=iJJmMv1AYo/CcFdiOWwO1Aw4UZ6JmEOUeJFRNH6sBiih58Xk0HCCLhzGKwV0DkjpSb HxkQ97bRt5Rk1NstBiBVzCLbNJVboPlqhj7LOgeEX2Q/fD1olumuW/rSYtda/gwgDdtS CmSzNoLs4zf7ZzJVjca1PDYTs2E0KhbPW/mt+2i/HW/8m1O/ZZ09iWMsB5+XF1OEOILg w1ELOWtIx+HJva3nTkBiLPLWSPrCEZPrTHizHIxqgjJzMZwItJeQRa32ZVrayHdToGz8 E8XXpJlduO+0QocChA40cJ9r+28e9GX3bbZUAz6a497j7Dvla67dZ8/Hb4JmMP+iBZPR /ygQ== X-Forwarded-Encrypted: i=1; AJvYcCVZhGumwGhf7lKdAmgIS8n/W4+BJLaPfcXO+eC4ziR5ZaitFnCDBOtsylWQF1FcT9fZL5a8xyHhMdUs88j3esQ= X-Gm-Message-State: AOJu0YxC5UyMcQv6fzxMq5SLL2U+ue95IgkYA0XVOywPoc4pcbXb0onB 0MUyR9QRhuwWEMYUbaf2E051TED0RtMzbRGw+B1wikihosTEq1uajt+EfOPoZj2WjRO2dP3IVeD Q0JUcCXhD16BFn7OC/74uV/kqGIB1+iemIPGXysXefFKj X-Received: by 2002:a25:d3c6:0:b0:dcc:ec02:38b0 with SMTP id e189-20020a25d3c6000000b00dccec0238b0mr14248638ybf.64.1708462206365; Tue, 20 Feb 2024 12:50:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYihGHkIJloe0kO6LpQf+xLz5QIAGJW87pBcGr93D66sDQOjYpZhq1D+iIs/xSKLUIAGaTzw== X-Received: by 2002:a25:d3c6:0:b0:dcc:ec02:38b0 with SMTP id e189-20020a25d3c6000000b00dccec0238b0mr14248624ybf.64.1708462206085; Tue, 20 Feb 2024 12:50:06 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id p13-20020ae9f30d000000b00787224025e0sm3682545qkg.130.2024.02.20.12.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 12:50:05 -0800 (PST) Message-ID: Subject: Re: [PATCH] libgccjit: Add option to allow special characters in function names From: David Malcolm To: Antoni Boucher , "gcc-patches@gcc.gnu.org" , "jit@gcc.gnu.org" Date: Tue, 20 Feb 2024 15:50:05 -0500 In-Reply-To: <63ab69e027ce69d97dd361561675d3c323983b92.camel@zoho.com> References: <63ab69e027ce69d97dd361561675d3c323983b92.camel@zoho.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On Thu, 2024-02-15 at 17:08 -0500, Antoni Boucher wrote: > Hi. > This patch adds a new option to allow special characters like . and $ > in function names. > This is useful to allow for mangling using those characters. > Thanks for the review. Thanks for the patch. > diff --git a/gcc/jit/docs/topics/contexts.rst b/gcc/jit/docs/topics/conte= xts.rst > index 10a0e50f9f6..4af75ea7418 100644 > --- a/gcc/jit/docs/topics/contexts.rst > +++ b/gcc/jit/docs/topics/contexts.rst > @@ -453,6 +453,10 @@ Boolean options > If true, the :type:`gcc_jit_context` will not clean up intermediate= files > written to the filesystem, and will display their location on stder= r. > =20 > + .. macro:: GCC_JIT_BOOL_OPTION_SPECIAL_CHARS_IN_FUNC_NAMES > + > + If true, allow special characters like . and $ in function names. The documentation and the comment in libgccjit.h say: "allow special characters like . and $ in function names." and on reading the implementation, the special characters are exactly '.' and '$'. The API seems rather arbitrary and inflexible to me; why the choice of those characters? Presumably those are the ones that Rust's mangling scheme uses, but do other mangling schemes require other chars? How about an API for setting the valid chars, something like: extern void gcc_jit_context_set_valid_symbol_chars (gcc_jit_context *ctxt, const char *chars); to specify the chars that are valid in addition to underscore and alphanumeric. In your case you'd call: gcc_jit_context_set_valid_symbol_chars (ctxt, ".$"); Or is that overkill? Dave