From patchwork Mon Jul 25 12:39:46 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: 156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp1645667pxt; Mon, 25 Jul 2022 06:17:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmt1Cg//7yaxCmjYPBtriKvEZLkF6WZKtpc5B9YMeKevLMvbrg8espbiyRpu6j79nfwkl6 X-Received: by 2002:a05:6402:5192:b0:43b:d728:d2aa with SMTP id q18-20020a056402519200b0043bd728d2aamr13464466edd.185.1658755071059; Mon, 25 Jul 2022 06:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658755071; cv=none; d=google.com; s=arc-20160816; b=wZlp6/uy5xjcxAwws1AgEUS/knM20ZztOBHe3pEAl0hhIrprH+CAR1Naqr1BbBBU/a 8u6VQLVjGfSL6SdQCox++UCUbvNbaSMrBfQqcCNt6bVG4HPgKQXYs3rRpMms54RgwGRO ZplQcInefgqNi+NU2zZnnqOQxyG5fJvHb5aROWiBPbfplUlKtE7HV7OKJrZmutWUyxFU 2L7cIUGMIsOPTfi4Jl005Wl0Nl5qVdH6iUdgh1F1947/eknVx2zcxvyOlQyuTeTY9+lJ 5Ef4tbievT1cTDiRSAeGtHcSTX4HOOj29niLwMl61F2bbWS3EhIW8Xwow09irSXWBocL YFWw== 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=BDDDofu7lcVGa+3FX09FznjtPL+pIg0sGQ+rtASnANA=; b=jrgFU/rUp6BsCCV9T+ieP3kMLg5oKQb/EKFExYzpewmfuJWewsRYy0ozk1P9yMyYCr OnVIyKYD16yh0ZIVxFLF+w+1JH1LUe1TKvtn/4EQm+7g4hJFVni3GC1IncXfocB68Eoo /FInGP9czn5+Lf3ZdQTnntfYmKju4aLjzrsqyq7JNhA8SuKeAc7xilqJcD8yAJ5AGs99 Ijscabe1aqaYWZH/U2oOcGZvTvw8wlct6i9UFFH361OhQHYQOb1Eq3h7WM9SjPmspAFF ew9JGw8Cqxwom12gLskvn2IGzqJAoiJ4zu/GnptjR1USbAFnmKG6hVYpnfWSplKfq6vI faMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@suse.cz header.s=susede2_rsa header.b=1d32uUj4; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=SvUDy+lO; 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 qw2-20020a1709066a0200b0072efa4fb55asi15640163ejc.661.2022.07.25.06.17.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 06:17:51 -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=1d32uUj4; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=SvUDy+lO; 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 39E0038316C1 for ; Mon, 25 Jul 2022 13:15:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id D0B97383821A for ; Mon, 25 Jul 2022 13:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0B97383821A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail 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-out2.suse.de (Postfix) with ESMTPS id E5E451FD4B; 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=BDDDofu7lcVGa+3FX09FznjtPL+pIg0sGQ+rtASnANA=; b=1d32uUj4kUe0KsrOLnKDb2RisDJZ2ukPBnPmcfbCgM3FZp2fYWvq/aS2HnF4Aq6pGxd3Lj eWSBQFip7wR1j3By/e8G2+oaCVk0qfjRrxgQXH7AvmW6joNXu9+NHUhacjSXhO+BTb3SSu vChSGWtvAXb3UuvAz6eiGjpaqFf/Oyk= 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=BDDDofu7lcVGa+3FX09FznjtPL+pIg0sGQ+rtASnANA=; b=SvUDy+lOIgMStNjP5Ce8n2OOyEODcPWTnCyEdZp5y6k7GYpIk4nchPvbck6hgcb1mKue/B b/AOsSuGplPBGoCQ== 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 CED1013B56; 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 9oInMWaX3mIWdgAAMHmgww (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: <746778e2-d95c-f52f-1e3d-91611d7fad4a@suse.cz> Message-Id: <10eed23621fedb630b49a9cbe89aeab8aa009ac7.1658754788.git.mliska@suse.cz> In-Reply-To: References: From: Martin Liska Date: Mon, 25 Jul 2022 14:39:46 +0200 Subject: [PATCH 6/7] jit,docs: use :expr:`type *` for pointers to a type To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, 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?1739330757467237954?= X-GMAIL-MSGID: =?utf-8?q?1739330757467237954?= gcc/jit/ChangeLog: * docs/cp/intro/tutorial02.rst: Use :expr:`type *` for pointers to a type * docs/cp/topics/asm.rst: Likewise. * docs/cp/topics/contexts.rst: Likewise. * docs/cp/topics/expressions.rst: Likewise. * docs/cp/topics/functions.rst: Likewise. * docs/cp/topics/objects.rst: Likewise. * docs/intro/tutorial02.rst: Likewise. * docs/intro/tutorial03.rst: Likewise. * docs/intro/tutorial04.rst: Likewise. * docs/intro/tutorial05.rst: Likewise. * docs/topics/compilation.rst: Likewise. * docs/topics/contexts.rst: Likewise. * docs/topics/objects.rst: Likewise. --- gcc/jit/docs/cp/intro/tutorial02.rst | 4 ++-- gcc/jit/docs/cp/topics/asm.rst | 2 +- gcc/jit/docs/cp/topics/contexts.rst | 6 +++--- gcc/jit/docs/cp/topics/expressions.rst | 4 ++-- gcc/jit/docs/cp/topics/functions.rst | 2 +- gcc/jit/docs/cp/topics/objects.rst | 2 +- gcc/jit/docs/intro/tutorial02.rst | 16 +++++++-------- gcc/jit/docs/intro/tutorial03.rst | 28 +++++++++++++------------- gcc/jit/docs/intro/tutorial04.rst | 2 +- gcc/jit/docs/intro/tutorial05.rst | 4 ++-- gcc/jit/docs/topics/compilation.rst | 8 ++++---- gcc/jit/docs/topics/contexts.rst | 6 +++--- gcc/jit/docs/topics/objects.rst | 6 +++--- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/gcc/jit/docs/cp/intro/tutorial02.rst b/gcc/jit/docs/cp/intro/tutorial02.rst index 55675cc7398..9f9a7f3858e 100644 --- a/gcc/jit/docs/cp/intro/tutorial02.rst +++ b/gcc/jit/docs/cp/intro/tutorial02.rst @@ -39,7 +39,7 @@ First we need to include the relevant header: All state associated with compilation is associated with a :type:`gccjit::context`, which is a thin C++ wrapper around the C API's -:c:type:`gcc_jit_context *`. +:c:expr:`gcc_jit_context *`. Create one using :func:`gccjit::context::acquire`: @@ -194,7 +194,7 @@ OK, we've populated the context. We can now compile it using gcc_jit_result *result; result = ctxt.compile (); -and get a :c:type:`gcc_jit_result *`. +and get a :c:expr:`gcc_jit_result *`. We can now use :c:func:`gcc_jit_result_get_code` to look up a specific machine code routine within the result, in this case, the function we diff --git a/gcc/jit/docs/cp/topics/asm.rst b/gcc/jit/docs/cp/topics/asm.rst index f7e4e952b10..0d63da3d59e 100644 --- a/gcc/jit/docs/cp/topics/asm.rst +++ b/gcc/jit/docs/cp/topics/asm.rst @@ -43,7 +43,7 @@ Adding assembler instructions within a function to outputs. :class:`gccjit::extended_asm` is a subclass of :class:`gccjit::object`. - It is a thin wrapper around the C API's :c:type:`gcc_jit_extended_asm *`. + It is a thin wrapper around the C API's :c:expr:`gcc_jit_extended_asm *`. To avoid having an API entrypoint with a very large number of parameters, an extended ``asm`` statement is made in stages: diff --git a/gcc/jit/docs/cp/topics/contexts.rst b/gcc/jit/docs/cp/topics/contexts.rst index f60f2102b3e..2f2456a9c0d 100644 --- a/gcc/jit/docs/cp/topics/contexts.rst +++ b/gcc/jit/docs/cp/topics/contexts.rst @@ -29,9 +29,9 @@ compilation. You can set up options on it, and add types, functions and code. Invoking :func:`gccjit::context::compile` on it gives you a -:c:type:`gcc_jit_result *`. +:c:expr:`gcc_jit_result *`. -It is a thin wrapper around the C API's :c:type:`gcc_jit_context *`. +It is a thin wrapper around the C API's :c:expr:`gcc_jit_context *`. Lifetime-management ------------------- @@ -48,7 +48,7 @@ cleanup of such objects is done for you when the context is released. .. function:: void gccjit::context::release () This function releases all resources associated with the given context. - Both the context itself and all of its :c:type:`gccjit::object *` + Both the context itself and all of its :expr:`gccjit::object *` instances are cleaned up. It should be called exactly once on a given context. diff --git a/gcc/jit/docs/cp/topics/expressions.rst b/gcc/jit/docs/cp/topics/expressions.rst index dec5b477811..01eb2898d0d 100644 --- a/gcc/jit/docs/cp/topics/expressions.rst +++ b/gcc/jit/docs/cp/topics/expressions.rst @@ -26,7 +26,7 @@ Rvalues A :class:`gccjit::rvalue` is an expression that can be computed. It is a subclass of :class:`gccjit::object`, and is a thin wrapper around -:c:type:`gcc_jit_rvalue *` from the C API. +:c:expr:`gcc_jit_rvalue *` from the C API. It can be simple, e.g.: @@ -491,7 +491,7 @@ a storage area (such as a variable). It is a subclass of :class:`gccjit::rvalue`, where the rvalue is computed by reading from the storage area. -It iss a thin wrapper around :c:type:`gcc_jit_lvalue *` from the C API. +It iss a thin wrapper around :c:expr:`gcc_jit_lvalue *` from the C API. .. function:: gccjit::rvalue \ gccjit::lvalue::get_address (gccjit::location loc) diff --git a/gcc/jit/docs/cp/topics/functions.rst b/gcc/jit/docs/cp/topics/functions.rst index 4e325ac3fef..24534cc5d4f 100644 --- a/gcc/jit/docs/cp/topics/functions.rst +++ b/gcc/jit/docs/cp/topics/functions.rst @@ -36,7 +36,7 @@ Params :class:`gccjit::param` is a subclass of :class:`gccjit::lvalue` (and thus of :class:`gccjit::rvalue` and :class:`gccjit::object`). It is a thin -wrapper around the C API's :c:type:`gcc_jit_param *`. +wrapper around the C API's :c:expr:`gcc_jit_param *`. Functions --------- diff --git a/gcc/jit/docs/cp/topics/objects.rst b/gcc/jit/docs/cp/topics/objects.rst index d81a84cab40..ca9243b1c71 100644 --- a/gcc/jit/docs/cp/topics/objects.rst +++ b/gcc/jit/docs/cp/topics/objects.rst @@ -23,7 +23,7 @@ Objects .. class:: gccjit::object Almost every entity in the API (with the exception of -:class:`gccjit::context` and :c:type:`gcc_jit_result *`) is a +:class:`gccjit::context` and :c:expr:`gcc_jit_result *`) is a "contextual" object, a :class:`gccjit::object`. A JIT object: diff --git a/gcc/jit/docs/intro/tutorial02.rst b/gcc/jit/docs/intro/tutorial02.rst index 5739548b0e3..9fcaad5518c 100644 --- a/gcc/jit/docs/intro/tutorial02.rst +++ b/gcc/jit/docs/intro/tutorial02.rst @@ -38,7 +38,7 @@ First we need to include the relevant header: #include All state associated with compilation is associated with a -:c:type:`gcc_jit_context *`. +:c:expr:`gcc_jit_context *`. Create one using :c:func:`gcc_jit_context_acquire`: @@ -50,7 +50,7 @@ Create one using :c:func:`gcc_jit_context_acquire`: The JIT library has a system of types. It is statically-typed: every expression is of a specific type, fixed at compile-time. In our example, all of the expressions are of the C `int` type, so let's obtain this from -the context, as a :c:type:`gcc_jit_type *`, using +the context, as a :c:expr:`gcc_jit_type *`, using :c:func:`gcc_jit_context_get_type`: .. code-block:: c @@ -58,8 +58,8 @@ the context, as a :c:type:`gcc_jit_type *`, using gcc_jit_type *int_type = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); -:c:type:`gcc_jit_type *` is an example of a "contextual" object: every -entity in the API is associated with a :c:type:`gcc_jit_context *`. +:c:expr:`gcc_jit_type *` is an example of a "contextual" object: every +entity in the API is associated with a :c:expr:`gcc_jit_context *`. Memory management is easy: all such "contextual" objects are automatically cleaned up for you when the context is released, using @@ -93,7 +93,7 @@ For example, :c:func:`gcc_jit_type_as_object`: gcc_jit_object *obj = gcc_jit_type_as_object (int_type); -One thing you can do with a :c:type:`gcc_jit_object *` is +One thing you can do with a :c:expr:`gcc_jit_object *` is to ask it for a human-readable description, using :c:func:`gcc_jit_object_get_debug_string`: @@ -157,8 +157,8 @@ We can build the expression using :c:func:`gcc_jit_context_new_binary_op`: gcc_jit_param_as_rvalue (param_i), gcc_jit_param_as_rvalue (param_i)); -A :c:type:`gcc_jit_rvalue *` is another example of a -:c:type:`gcc_jit_object *` subclass. We can upcast it using +A :c:expr:`gcc_jit_rvalue *` is another example of a +:c:expr:`gcc_jit_object *` subclass. We can upcast it using :c:func:`gcc_jit_rvalue_as_object` and as before print it with :c:func:`gcc_jit_object_get_debug_string`. @@ -190,7 +190,7 @@ OK, we've populated the context. We can now compile it using gcc_jit_result *result; result = gcc_jit_context_compile (ctxt); -and get a :c:type:`gcc_jit_result *`. +and get a :c:expr:`gcc_jit_result *`. At this point we're done with the context; we can release it: diff --git a/gcc/jit/docs/intro/tutorial03.rst b/gcc/jit/docs/intro/tutorial03.rst index 50d71ba6d1a..478ea2721de 100644 --- a/gcc/jit/docs/intro/tutorial03.rst +++ b/gcc/jit/docs/intro/tutorial03.rst @@ -55,7 +55,7 @@ Here's what the final control flow graph will look like: :alt: image of a control flow graph As before, we include the libgccjit header and make a -:c:type:`gcc_jit_context *`. +:c:expr:`gcc_jit_context *`. .. code-block:: c @@ -98,14 +98,14 @@ Let's build the function: Expressions: lvalues and rvalues ******************************** -The base class of expression is the :c:type:`gcc_jit_rvalue *`, +The base class of expression is the :c:expr:`gcc_jit_rvalue *`, representing an expression that can be on the *right*-hand side of an assignment: a value that can be computed somehow, and assigned *to* a storage area (such as a variable). It has a specific -:c:type:`gcc_jit_type *`. +:c:expr:`gcc_jit_type *`. -Anothe important class is :c:type:`gcc_jit_lvalue *`. -A :c:type:`gcc_jit_lvalue *`. is something that can of the *left*-hand +Anothe important class is :c:expr:`gcc_jit_lvalue *`. +A :c:expr:`gcc_jit_lvalue *`. is something that can of the *left*-hand side of an assignment: a storage area (such as a variable). In other words, every assignment can be thought of as: @@ -114,8 +114,8 @@ In other words, every assignment can be thought of as: LVALUE = RVALUE; -Note that :c:type:`gcc_jit_lvalue *` is a subclass of -:c:type:`gcc_jit_rvalue *`, where in an assignment of the form: +Note that :c:expr:`gcc_jit_lvalue *` is a subclass of +:c:expr:`gcc_jit_rvalue *`, where in an assignment of the form: .. code-block:: c @@ -135,10 +135,10 @@ So far the only expressions we've seen are `i * i`: gcc_jit_param_as_rvalue (param_i), gcc_jit_param_as_rvalue (param_i)); -which is a :c:type:`gcc_jit_rvalue *`, and the various function +which is a :c:expr:`gcc_jit_rvalue *`, and the various function parameters: `param_i` and `param_n`, instances of -:c:type:`gcc_jit_param *`, which is a subclass of -:c:type:`gcc_jit_lvalue *` (and, in turn, of :c:type:`gcc_jit_rvalue *`): +:c:expr:`gcc_jit_param *`, which is a subclass of +:c:expr:`gcc_jit_lvalue *` (and, in turn, of :c:expr:`gcc_jit_rvalue *`): we can both read from and write to function parameters within the body of a function. @@ -154,7 +154,7 @@ name: gcc_jit_lvalue *sum = gcc_jit_function_new_local (func, NULL, the_type, "sum"); -These are instances of :c:type:`gcc_jit_lvalue *` - they can be read from +These are instances of :c:expr:`gcc_jit_lvalue *` - they can be read from and written to. Note that there is no precanned way to create *and* initialize a variable @@ -178,8 +178,8 @@ handle the control flow. In this case, we need 4 blocks: 3. the body of the loop 4. after the loop terminates (`return sum`) -so we create these as :c:type:`gcc_jit_block *` instances within the -:c:type:`gcc_jit_function *`: +so we create these as :c:expr:`gcc_jit_block *` instances within the +:c:expr:`gcc_jit_function *`: .. code-block:: c @@ -224,7 +224,7 @@ We can then terminate the entry block by jumping to the conditional: The conditional block is equivalent to the line `while (i < n)` from our C example. It contains a single statement: a conditional, which jumps to one of two destination blocks depending on a boolean -:c:type:`gcc_jit_rvalue *`, in this case the comparison of `i` and `n`. +:c:expr:`gcc_jit_rvalue *`, in this case the comparison of `i` and `n`. We build the comparison using :c:func:`gcc_jit_context_new_comparison`: .. code-block:: c diff --git a/gcc/jit/docs/intro/tutorial04.rst b/gcc/jit/docs/intro/tutorial04.rst index c2e3fb5c054..a08119f51b1 100644 --- a/gcc/jit/docs/intro/tutorial04.rst +++ b/gcc/jit/docs/intro/tutorial04.rst @@ -126,7 +126,7 @@ then directly executed in-process: :end-before: enum opcode :language: c -The lifetime of the code is tied to that of a :c:type:`gcc_jit_result *`. +The lifetime of the code is tied to that of a :c:expr:`gcc_jit_result *`. We'll handle this by bundling them up in a structure, so that we can clean them up together by calling :c:func:`gcc_jit_result_release`: diff --git a/gcc/jit/docs/intro/tutorial05.rst b/gcc/jit/docs/intro/tutorial05.rst index b977d1ddf59..1c4774486be 100644 --- a/gcc/jit/docs/intro/tutorial05.rst +++ b/gcc/jit/docs/intro/tutorial05.rst @@ -95,7 +95,7 @@ Here's what a simple ``.bf`` script looks like: Converting a brainf script to libgccjit IR ****************************************** -As before we write simple code to populate a :c:type:`gcc_jit_context *`. +As before we write simple code to populate a :c:expr:`gcc_jit_context *`. .. literalinclude:: ../examples/tut05-bf.c :start-after: #define MAX_OPEN_PARENS 16 @@ -261,7 +261,7 @@ state ``idx`` and ``data_cells``: Other forms of ahead-of-time-compilation **************************************** -The above demonstrates compiling a :c:type:`gcc_jit_context *` directly +The above demonstrates compiling a :c:expr:`gcc_jit_context *` directly to an executable. It's also possible to compile it to an object file, and to a dynamic library. See the documentation of :c:func:`gcc_jit_context_compile_to_file` for more information. diff --git a/gcc/jit/docs/topics/compilation.rst b/gcc/jit/docs/topics/compilation.rst index adcde8d8eb9..3dd9bc6f5f7 100644 --- a/gcc/jit/docs/topics/compilation.rst +++ b/gcc/jit/docs/topics/compilation.rst @@ -20,7 +20,7 @@ Compiling a context =================== -Once populated, a :c:type:`gcc_jit_context *` can be compiled to +Once populated, a :c:expr:`gcc_jit_context *` can be compiled to machine code, either in-memory via :c:func:`gcc_jit_context_compile` or to disk via :c:func:`gcc_jit_context_compile_to_file`. @@ -80,7 +80,7 @@ In-memory compilation Note that the resulting machine code becomes invalid after :func:`gcc_jit_result_release` is called on the - :type:`gcc_jit_result *`; attempting to call it after that may lead + :expr:`gcc_jit_result *`; attempting to call it after that may lead to a segmentation fault. .. function:: void *\ @@ -125,7 +125,7 @@ In-memory compilation Note that the resulting address becomes invalid after :func:`gcc_jit_result_release` is called on the - :type:`gcc_jit_result *`; attempting to use it after that may lead + :expr:`gcc_jit_result *`; attempting to use it after that may lead to a segmentation fault. .. function:: void\ @@ -153,7 +153,7 @@ For linking in object files, use :c:func:`gcc_jit_context_add_driver_option`. enum gcc_jit_output_kind output_kind,\ const char *output_path) - Compile the :c:type:`gcc_jit_context *` to a file of the given + Compile the :c:expr:`gcc_jit_context *` to a file of the given kind. :c:func:`gcc_jit_context_compile_to_file` ignores the suffix of diff --git a/gcc/jit/docs/topics/contexts.rst b/gcc/jit/docs/topics/contexts.rst index 205b5f3dcf5..f746e2819d2 100644 --- a/gcc/jit/docs/topics/contexts.rst +++ b/gcc/jit/docs/topics/contexts.rst @@ -39,14 +39,14 @@ cleanup of such objects is done for you when the context is released. .. function:: gcc_jit_context *gcc_jit_context_acquire (void) - This function acquires a new :c:type:`gcc_jit_context *` instance, + This function acquires a new :c:expr:`gcc_jit_context *` instance, which is independent of any others that may be present within this process. .. function:: void gcc_jit_context_release (gcc_jit_context *ctxt) This function releases all resources associated with the given context. - Both the context itself and all of its :c:type:`gcc_jit_object *` + Both the context itself and all of its :c:expr:`gcc_jit_object *` instances are cleaned up. It should be called exactly once on a given context. @@ -89,7 +89,7 @@ cleanup of such objects is done for you when the context is released. Thread-safety ------------- -Instances of :c:type:`gcc_jit_context *` created via +Instances of :c:expr:`gcc_jit_context *` created via :c:func:`gcc_jit_context_acquire` are independent from each other: only one thread may use a given context at once, but multiple threads could each have their own contexts without needing locks. diff --git a/gcc/jit/docs/topics/objects.rst b/gcc/jit/docs/topics/objects.rst index cd117e2937e..42f3675cd1a 100644 --- a/gcc/jit/docs/topics/objects.rst +++ b/gcc/jit/docs/topics/objects.rst @@ -23,12 +23,12 @@ Objects .. type:: gcc_jit_object Almost every entity in the API (with the exception of -:c:type:`gcc_jit_context *` and :c:type:`gcc_jit_result *`) is a -"contextual" object, a :c:type:`gcc_jit_object *` +:c:expr:`gcc_jit_context *` and :c:expr:`gcc_jit_result *`) is a +"contextual" object, a :c:expr:`gcc_jit_object *` A JIT object: - * is associated with a :c:type:`gcc_jit_context *`. + * is associated with a :c:expr:`gcc_jit_context *`. * is automatically cleaned up for you when its context is released so you don't need to manually track and cleanup all objects, just the