public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Walk pointer_to and reference_to chain in free_lang_data
Date: Thu, 23 Aug 2018 12:00:00 -0000	[thread overview]
Message-ID: <20180823120036.GA64917@kam.mff.cuni.cz> (raw)
In-Reply-To: <alpine.LSU.2.20.1808220928220.16707@zhemvz.fhfr.qr>

> >   tree type_decl = build_decl (input_location, TYPE_DECL,                       
> >                                get_identifier ("__asan_global"), ret);          
> >   DECL_IGNORED_P (type_decl) = 1;                                               
> >   DECL_ARTIFICIAL (type_decl) = 1;                                              
> >   TYPE_FIELDS (ret) = fields[0];                                                
> >   TYPE_NAME (ret) = type_decl;                                                  
> >   TYPE_STUB_DECL (ret) = type_decl;                                             
> > 
> > It seems to me that setting TYPE_NAME to identifier node would be easier.
> 
> Yeah.  I probably added the DECL_INGORED_P to most of those so indeed
> type_decls are somewhat pointless.

OK, I have tried to remove them and it passes bootstrap/regtest x86-64.
Looks sane?

Honza

	* asan.c (asan_global_struct): Turn TYPE_NAME into identifier.
	(ubsan_get_type_descriptor_type,
	ubsan_get_source_location_type,
	ubsan_create_data): Likewise.
Index: asan.c
===================================================================
--- asan.c	(revision 263696)
+++ asan.c	(working copy)
@@ -2515,13 +2515,8 @@ asan_global_struct (void)
       if (i)
 	DECL_CHAIN (fields[i - 1]) = fields[i];
     }
-  tree type_decl = build_decl (input_location, TYPE_DECL,
-			       get_identifier ("__asan_global"), ret);
-  DECL_IGNORED_P (type_decl) = 1;
-  DECL_ARTIFICIAL (type_decl) = 1;
   TYPE_FIELDS (ret) = fields[0];
-  TYPE_NAME (ret) = type_decl;
-  TYPE_STUB_DECL (ret) = type_decl;
+  TYPE_NAME (ret) = get_identifier ("__asan_global");
   layout_type (ret);
   return ret;
 }
Index: ubsan.c
===================================================================
--- ubsan.c	(revision 263696)
+++ ubsan.c	(working copy)
@@ -221,14 +221,8 @@ ubsan_get_type_descriptor_type (void)
       if (i)
 	DECL_CHAIN (fields[i - 1]) = fields[i];
     }
-  tree type_decl = build_decl (input_location, TYPE_DECL,
-			       get_identifier ("__ubsan_type_descriptor"),
-			       ret);
-  DECL_IGNORED_P (type_decl) = 1;
-  DECL_ARTIFICIAL (type_decl) = 1;
   TYPE_FIELDS (ret) = fields[0];
-  TYPE_NAME (ret) = type_decl;
-  TYPE_STUB_DECL (ret) = type_decl;
+  TYPE_NAME (ret) = get_identifier ("__ubsan_type_descriptor");
   layout_type (ret);
   ubsan_type_descriptor_type = ret;
   return ret;
@@ -269,14 +263,8 @@ ubsan_get_source_location_type (void)
       if (i)
 	DECL_CHAIN (fields[i - 1]) = fields[i];
     }
-  tree type_decl = build_decl (input_location, TYPE_DECL,
-			       get_identifier ("__ubsan_source_location"),
-			       ret);
-  DECL_IGNORED_P (type_decl) = 1;
-  DECL_ARTIFICIAL (type_decl) = 1;
   TYPE_FIELDS (ret) = fields[0];
-  TYPE_NAME (ret) = type_decl;
-  TYPE_STUB_DECL (ret) = type_decl;
+  TYPE_NAME (ret) = get_identifier ("__ubsan_source_location");
   layout_type (ret);
   ubsan_source_location_type = ret;
   return ret;
@@ -586,13 +574,8 @@ ubsan_create_data (const char *name, int
     }
   va_end (args);
 
-  tree type_decl = build_decl (input_location, TYPE_DECL,
-			       get_identifier (name), ret);
-  DECL_IGNORED_P (type_decl) = 1;
-  DECL_ARTIFICIAL (type_decl) = 1;
   TYPE_FIELDS (ret) = fields[0];
-  TYPE_NAME (ret) = type_decl;
-  TYPE_STUB_DECL (ret) = type_decl;
+  TYPE_NAME (ret) = get_identifier (name);
   layout_type (ret);
 
   /* Now, fill in the type.  */

  parent reply	other threads:[~2018-08-23 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 21:06 Jan Hubicka
2018-08-22  7:11 ` Richard Biener
2018-08-22  7:23   ` Jan Hubicka
2018-08-22  7:31     ` Richard Biener
2018-08-22  8:00       ` Jan Hubicka
2018-08-23 12:00       ` Jan Hubicka [this message]
2018-08-23 12:06         ` Richard Biener
2018-08-23 12:06       ` Jan Hubicka
2018-08-23 12:20         ` Richard Biener
2018-08-23 12:26           ` Jan Hubicka

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=20180823120036.GA64917@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).