From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id D1CA43858D20; Tue, 20 Feb 2024 21:05:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1CA43858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D1CA43858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708463132; cv=none; b=TtGweV0bnryamk6gEheCFoGiHDQI/Nl5VZVcDsEwCDBTOe4o7zl6JOtWRH4ZMjtEqE7TAC9PFNkTysmtsr8MQ83mxALrN81Jw+yYL8vpa24bp49PEZO4Odq5MKoPdKyqxWfg1aiJLU9V6iNk8HIcKd+5g9nRUJxMwCDVm7Ic7pw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708463132; c=relaxed/simple; bh=VVOnKARO3wERpoVOo10ZonTM2LmFr4QLJCKGCSRU1Go=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=YFCcVaXVsohcymd2iAV8YhT8b62AIhwXifPVeCqKQh2hPWp1VhROgc/iCzB2qqXw4zs+TCvV+QisFyi2RxbtbTJzV0Gb7bJQMFcj6p9XUPuEs7FcmaK3axEMv3kGPPHQAX6KegzibRIK4+BzbtbX+wYFtBG1tTTp702zdrEeI24= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4126aa42402so14907015e9.0; Tue, 20 Feb 2024 13:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1708463129; x=1709067929; darn=gcc.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KSrYuIt55UIMg8ghsh2Un25bxLN9ZTNQjLFVji2JErg=; b=SQqCMsWgdx4U3qRqr83hYTQslHWTERHwtyyAFHIb7bvXusprLysE3PALXey7i2Vi5O qFGJZD/BijyH73ZPxdRtek5Y4eVbBYUrehcu8JKU34ZDg85g/DYMVibrlKxTkj/cRFm4 Looa3ZSByPji3itj7NSapgrWNSrNT8O3BAMlkizquRXOZrBF993yyDWBt9s6fnYIaIAU 89sa87FpGECULhOkjDL1dc2JRqLbeuiYEnWHAAkYcev7zwDRM3ovFIi2/PGaubP9AKnA PfVTis7yWDg2ZauTJ47mjRh1qy/4Whb/48yzrQa4S70SVh1PmKPIB+CH7rwmoZOnu5Jz 95rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708463129; x=1709067929; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KSrYuIt55UIMg8ghsh2Un25bxLN9ZTNQjLFVji2JErg=; b=OLT0H6hd1V3qyAfzdqqk+5yb4CPskLw70yPd3VLVXeZB0/DkafAonx0Dfz+Stsvyuk knm4d4zfpkG7zwFvNXfH6eXWpsvPZ+E3tvIIts/Qrt6b5a0Ek8riDZHsQel9UgRyPbF7 gV0ApHxEbb0SCYBBvtD9neiuCrYcatU8pms252mZhqXbquREoDA3KmNnRsQLQTXKq4vL sckto5znKdNUnuHnWaKKFSg4KgHHdaVKePTB5SP/y4TGtnUfP0lhtEKL//iZ05qC5q51 dqlctbEzYmhmrQr6+1kJSEZZT0LUs5zL7e4Sbv4NomBWUwtAy5ShYuVO0/la7zs0Wn1S kUGw== X-Forwarded-Encrypted: i=1; AJvYcCV15cmUmgextIz0h4Ph+GUZxZ77tpAiMk5kuQ+s0HcqdWkZRVzaYYejuqzINBTBnPZgQ3viO+fIH/YxK3Kx82EztMBtMb3hZp6GdPxDGshDOoZpB7F0kV+5 X-Gm-Message-State: AOJu0YxK7jbt9pnMvrlt4G32u0o+/bwiLTeOgg7pMeNGwYJNra4t2bIX XWpMDGfqNw5ZL6manUDtXrXBLTPloFCLbrxXGhPmgggpxjL4dDCQ X-Google-Smtp-Source: AGHT+IEaVc8lG2TptDabDEDUzh3bV1LwDxmHGqtsbCO0DrcfyjLq+flgGf09REnvannx2KvBIw3BPQ== X-Received: by 2002:a5d:5081:0:b0:33d:39b8:7f0b with SMTP id a1-20020a5d5081000000b0033d39b87f0bmr4745490wrt.71.1708463129305; Tue, 20 Feb 2024 13:05:29 -0800 (PST) Received: from smtpclient.apple (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id h5-20020a05600016c500b0033d60cba289sm5349433wrf.68.2024.02.20.13.05.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2024 13:05:28 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: [PATCH] libgccjit: Add option to allow special characters in function names From: Iain Sandoe In-Reply-To: Date: Tue, 20 Feb 2024 21:05:25 +0000 Cc: Antoni Boucher , GCC Patches , "jit@gcc.gnu.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <63ab69e027ce69d97dd361561675d3c323983b92.camel@zoho.com> To: David Malcolm X-Mailer: Apple Mail (2.3696.120.41.1.4) X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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: > On 20 Feb 2024, at 20:50, David Malcolm wrote: >=20 > 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. >=20 > Thanks for the patch. >=20 >> diff --git a/gcc/jit/docs/topics/contexts.rst = b/gcc/jit/docs/topics/contexts.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 = stderr. >>=20 >> + .. macro:: GCC_JIT_BOOL_OPTION_SPECIAL_CHARS_IN_FUNC_NAMES >> + >> + If true, allow special characters like . and $ in function = names. >=20 > 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 '$'. >=20 > 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? >=20 > How about an API for setting the valid chars, something like: >=20 > extern void > gcc_jit_context_set_valid_symbol_chars (gcc_jit_context *ctxt, > const char *chars); >=20 > to specify the chars that are valid in addition to underscore and > alphanumeric. >=20 > In your case you'd call: >=20 > gcc_jit_context_set_valid_symbol_chars (ctxt, ".$"); >=20 > Or is that overkill? If we ever wanted to support objective-c (NeXT runtime) then we=E2=80=99d = need to be able to support +,-,[,] space and : at least. The interesting thing = there is that most assemblers do not support that either (and the symbols then = need to be quoted into the assembler) . So, it=E2=80=99s not (IMO) overkill considering at least one potential = extension. Iain >=20 > Dave >=20