public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
	 gofrontend-dev <gofrontend-dev@googlegroups.com>
Subject: Go patch commited: Set DECL_NAMELESS for temporaries
Date: Tue, 29 Jun 2021 12:22:45 -0700	[thread overview]
Message-ID: <CAOyqgcVF69OA4=uNEV2tOMtAo1ms2-63kpWXxzM=+1iL0zztyQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

This patch to the Go frontend sets DECL_NAMELESS for temporary
variables.  This is consistent with what create_tmp_var does, but is
used for cases where we can't use create_tmp_var.  Bootstrapped and
ran Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian

* go-gcc.cc (Gcc_backend::static_chain_variable): Set
DECL_NAMELESS on the new decl.
(Gcc_backend::temporary_variable): Likewise.
(Gcc_backend::function): Set DECL_NAMELESS on the result decl.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1055 bytes --]

diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 41f309e7294..f812796c959 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -2853,6 +2853,7 @@ Gcc_backend::static_chain_variable(Bfunction* function, const std::string& name,
   TREE_USED(decl) = 1;
   DECL_ARTIFICIAL(decl) = 1;
   DECL_IGNORED_P(decl) = 1;
+  DECL_NAMELESS(decl) = 1;
   TREE_READONLY(decl) = 1;
 
   struct function *f = DECL_STRUCT_FUNCTION(fndecl);
@@ -2912,6 +2913,7 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock,
 		       type_tree);
       DECL_ARTIFICIAL(var) = 1;
       DECL_IGNORED_P(var) = 1;
+      DECL_NAMELESS(var) = 1;
       TREE_USED(var) = 1;
       DECL_CONTEXT(var) = decl;
 
@@ -3290,6 +3292,7 @@ Gcc_backend::function(Btype* fntype, const std::string& name,
           build_decl(location.gcc_location(), RESULT_DECL, NULL_TREE, restype);
       DECL_ARTIFICIAL(resdecl) = 1;
       DECL_IGNORED_P(resdecl) = 1;
+      DECL_NAMELESS(resdecl) = 1;
       DECL_CONTEXT(resdecl) = decl;
       DECL_RESULT(decl) = resdecl;
     }

                 reply	other threads:[~2021-06-29 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOyqgcVF69OA4=uNEV2tOMtAo1ms2-63kpWXxzM=+1iL0zztyQ@mail.gmail.com' \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).