From patchwork Mon Jul 25 08:52:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp1646285pxt; Mon, 25 Jul 2022 06:19:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQ9XK4fXVzTwnSjDlohymQnIJLeBdfxfxbyRzzc4VWpsQJc4pJwmeC/ItCx3DlunKTXqzj X-Received: by 2002:a17:907:3d94:b0:72b:54bc:aa38 with SMTP id he20-20020a1709073d9400b0072b54bcaa38mr10306829ejc.679.1658755141194; Mon, 25 Jul 2022 06:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658755141; cv=none; d=google.com; s=arc-20160816; b=k5+WAIVslS5iHgQUO822efWaz4JNXt7SI4u5TAm8u2J3Na2V+wyP1ejzynPwxdDOCX a9aRtViLkN/IMlqe3L5IZbdkGtAEKk7Ing9XIYCt0SW1pEKhS2JjC7cJwAq+WWwlIR6T l88/BhtpjGtXIW2iOydcGLm7LtRx33JHNZr1z0GazOvM5RwUwEaRNX6RKSlLvFB0X9oV ub9CnAnJWk8tm1Xe6kriWSXlUmY3RUkUOY8eGSp5e0C5mNhFNHeVh8CDXaW+rE6fgnld EnFU9kygiAyufRLG2czaQfPtEizZn6OYkPiKtSQ3z1fTj3OtofjvauVE4vkGLXivsVL1 TClg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:subject:date:from:references :in-reply-to:message-id:resent-message-id:resent-date:resent-cc :resent-to:resent-from:dkim-signature:dkim-signature:dmarc-filter :delivered-to; bh=6qBzEb+UcxfOCMG3fhdIPGW+lg8xAyUDQRd0f9ipJus=; b=UpYNPQcADyRAbjJecPK/uKmSUzyETCD9Qr9WAz93qTDzLuIZpBv52DxiPyHd0nvwUc +JgtvI2zYdZEJNyrb7HG/g+9ajS9R8oxl8W07rZZX53mWj1OXNS9pYxh4uZMqOL6WwDf 6345vVTRAQESJgkQa+9RIr6HGeidB/2tHqOG6F3fWJguDrCE4n/jjLHnDdAUnGH2OeVj MsjcyMIHP8qDAaCpUrAtGrjS6g/ZIbq1Vdaxlr6hf4dC9GPkl0O9mhr1+vs8tpI6Zjq4 VokFkCX/UqlV0KZtfVsoU44FXM1bqy8dBNmJsGankU1s8o20LAFd9b6GaPcQdxbkmuSp P5bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@suse.cz header.s=susede2_rsa header.b=RXPGjIMe; dkim=neutral (no key) header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hd20-20020a170907969400b006ff278107bbsi10084352ejc.597.2022.07.25.06.19.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 06:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@suse.cz header.s=susede2_rsa header.b=RXPGjIMe; dkim=neutral (no key) header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 05619388B68B for ; Mon, 25 Jul 2022 13:16:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 80C0F3838203 for ; Mon, 25 Jul 2022 13:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80C0F3838203 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BB15D34B0D; Mon, 25 Jul 2022 13:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1658754918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: resent-to:resent-cc:resent-from:resent-message-id: in-reply-to:in-reply-to:references:references; bh=6qBzEb+UcxfOCMG3fhdIPGW+lg8xAyUDQRd0f9ipJus=; b=RXPGjIMeLzin/UXJJXfjsqtIGauhvF9nXUkH+vKmxQrrT5KGpYT7gRLQAO1dXljfRFnOwI J00RbS7cpw3Rnpb6wrUHtk4TJiVizkLSm27vaIvJGhPgisuhLrpJtlDbyAf/yLadwHsL1W XWxMsplzTfLli/6JVDyYjF8EUkC6ufE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1658754918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: resent-to:resent-cc:resent-from:resent-message-id: in-reply-to:in-reply-to:references:references; bh=6qBzEb+UcxfOCMG3fhdIPGW+lg8xAyUDQRd0f9ipJus=; b=Yvjsa90zoEenH+x8g0lOHaSD2aniVJ0f2kp5H6IR3SOqUScA7KkpORCG6QZ7revWHsMtAZ Cd0V/WiWNoaR0KCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A8DE013ABB; Mon, 25 Jul 2022 13:15:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uXX4J2aX3mIKdgAAMHmgww (envelope-from ); Mon, 25 Jul 2022 13:15:18 +0000 Resent-From: =?utf-8?q?Martin_Li=C5=A1ka?= Resent-To: GCC Patches Resent-Cc: David Malcolm Resent-Date: Mon, 25 Jul 2022 15:15:18 +0200 Resent-Message-ID: <944f3c83-2807-703f-dde6-2c6fe3114148@suse.cz> Message-Id: <19033b481059d9e603d837a5671da541a9cc742f.1658754788.git.mliska@suse.cz> In-Reply-To: References: From: Martin Liska Date: Mon, 25 Jul 2022 10:52:56 +0200 Subject: [PATCH 1/7] jit,docs: use enum directive for enumeral types To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-LABELS: =?utf-8?b?IlxcSW1wb3J0YW50Ig==?= X-GMAIL-THRID: =?utf-8?q?1739330830912624554?= X-GMAIL-MSGID: =?utf-8?q?1739330830912624554?= gcc/jit/ChangeLog: * docs/conf.py: Add needs_sphinx = '3.0' where c:type was added. * docs/index.rst: Remove note about it. * docs/topics/compilation.rst: Use enum directive and reference. * docs/topics/contexts.rst: Likewise. * docs/topics/expressions.rst: Likewise. * docs/topics/functions.rst: Likewise. --- gcc/jit/docs/conf.py | 3 +++ gcc/jit/docs/index.rst | 7 ------- gcc/jit/docs/topics/compilation.rst | 4 ++-- gcc/jit/docs/topics/contexts.rst | 6 +++--- gcc/jit/docs/topics/expressions.rst | 10 +++++----- gcc/jit/docs/topics/functions.rst | 2 +- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/gcc/jit/docs/conf.py b/gcc/jit/docs/conf.py index 00f0e9887dd..062232ae280 100644 --- a/gcc/jit/docs/conf.py +++ b/gcc/jit/docs/conf.py @@ -39,6 +39,9 @@ source_suffix = '.rst' # The master toctree document. master_doc = 'index' +# c:type directive is supported since 3.0 +needs_sphinx = '3.0' + # General information about the project. project = u'libgccjit' copyright = u'2014-2022 Free Software Foundation, Inc.' diff --git a/gcc/jit/docs/index.rst b/gcc/jit/docs/index.rst index 3aff17d7a60..21c3140e238 100644 --- a/gcc/jit/docs/index.rst +++ b/gcc/jit/docs/index.rst @@ -45,10 +45,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - -.. Some notes: - - The Sphinx C domain appears to lack explicit support for enum values, - so I've been using :c:macro: for them. - - See https://sphinx-doc.org/domains.html#the-c-domain diff --git a/gcc/jit/docs/topics/compilation.rst b/gcc/jit/docs/topics/compilation.rst index 9b1eed2dede..c5fa6eb0faf 100644 --- a/gcc/jit/docs/topics/compilation.rst +++ b/gcc/jit/docs/topics/compilation.rst @@ -158,14 +158,14 @@ For linking in object files, use :c:func:`gcc_jit_context_add_driver_option`. :c:func:`gcc_jit_context_compile_to_file` ignores the suffix of ``output_path``, and insteads uses the given -:c:type:`enum gcc_jit_output_kind` to decide what to do. +:c:enum:`gcc_jit_output_kind` to decide what to do. .. note:: This is different from the ``gcc`` program, which does make use of the suffix of the output file when determining what to do. -.. type:: enum gcc_jit_output_kind +.. enum:: gcc_jit_output_kind The available kinds of output are: diff --git a/gcc/jit/docs/topics/contexts.rst b/gcc/jit/docs/topics/contexts.rst index dfbe968e127..205b5f3dcf5 100644 --- a/gcc/jit/docs/topics/contexts.rst +++ b/gcc/jit/docs/topics/contexts.rst @@ -311,7 +311,7 @@ String Options Set a string option of the context. - .. type:: enum gcc_jit_str_option + .. enum:: gcc_jit_str_option The parameter ``value`` can be NULL. If non-NULL, the call takes a copy of the underlying string, so it is valid to pass in a pointer to @@ -334,7 +334,7 @@ Boolean options Set a boolean option of the context. Zero is "false" (the default), non-zero is "true". - .. type:: enum gcc_jit_bool_option + .. enum:: gcc_jit_bool_option .. macro:: GCC_JIT_BOOL_OPTION_DEBUGINFO @@ -513,7 +513,7 @@ Integer options Set an integer option of the context. - .. type:: enum gcc_jit_int_option + .. enum:: gcc_jit_int_option There is just one integer option specified this way: diff --git a/gcc/jit/docs/topics/expressions.rst b/gcc/jit/docs/topics/expressions.rst index 91ee8a9c74a..49b7e14ae2b 100644 --- a/gcc/jit/docs/topics/expressions.rst +++ b/gcc/jit/docs/topics/expressions.rst @@ -309,7 +309,7 @@ Unary Operations The parameter ``result_type`` must be a numeric type. -.. type:: enum gcc_jit_unary_op +.. enum:: gcc_jit_unary_op The available unary operations are: @@ -376,7 +376,7 @@ Binary Operations The parameter ``result_type`` must be a numeric type. -.. type:: enum gcc_jit_binary_op +.. enum:: gcc_jit_binary_op The available binary operations are: @@ -534,7 +534,7 @@ Comparisons Build a boolean rvalue out of the comparison of two other rvalues. -.. type:: enum gcc_jit_comparison +.. enum:: gcc_jit_comparison ======================================= ============ Comparison C equivalent @@ -711,7 +711,7 @@ where the rvalue is computed by reading from the storage area. The "model" parameter determines the thread-local storage model of the "lvalue": - .. type:: enum gcc_jit_tls_model + .. enum:: gcc_jit_tls_model .. c:macro:: GCC_JIT_TLS_MODEL_NONE @@ -841,7 +841,7 @@ Global variables The "kind" parameter determines the visibility of the "global" outside of the :c:type:`gcc_jit_result`: - .. type:: enum gcc_jit_global_kind + .. enum:: gcc_jit_global_kind .. c:macro:: GCC_JIT_GLOBAL_EXPORTED diff --git a/gcc/jit/docs/topics/functions.rst b/gcc/jit/docs/topics/functions.rst index 0845fe0f7d3..d6d4fe90834 100644 --- a/gcc/jit/docs/topics/functions.rst +++ b/gcc/jit/docs/topics/functions.rst @@ -80,7 +80,7 @@ Functions Create a gcc_jit_function with the given name and parameters. - .. type:: enum gcc_jit_function_kind + .. enum:: gcc_jit_function_kind This enum controls the kind of function created, and has the following values: