public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ PATCH] small pt.c cleanup
@ 2017-06-19 14:21 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2017-06-19 14:21 UTC (permalink / raw)
  To: GCC Patches

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

I discovered a cleanup I'd forgotten about.  The only unobvious thing 
about this patch is that just before the second hunk we've already set 
DECL_RTL to NULL.   No need to do it twice.

nathan
-- 
Nathan Sidwell

[-- Attachment #2: cln.diff --]
[-- Type: text/x-patch, Size: 1300 bytes --]

2017-06-19  Nathan Sidwell  <nathan@acm.org>

	* pt.c (coerce_template_parms): Fix indentation.
	(tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
	in to single block.

Index: pt.c
===================================================================
--- pt.c	(revision 249364)
+++ pt.c	(working copy)
@@ -8101,10 +8101,10 @@ coerce_template_parms (tree parms,
       parm = TREE_VEC_ELT (parms, parm_idx);
  
       if (parm == error_mark_node)
-      {
-        TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node;
-        continue;
-      }
+	{
+	  TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node;
+	  continue;
+	}
 
       /* Calculate the next argument.  */
       if (arg_idx < nargs)
@@ -12947,13 +12947,11 @@ tsubst_decl (tree t, tree args, tsubst_f
 	/* The initializer must not be expanded until it is required;
 	   see [temp.inst].  */
 	DECL_INITIAL (r) = NULL_TREE;
-	if (VAR_P (r))
-	  SET_DECL_MODE (r, VOIDmode);
-	if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL))
-	  SET_DECL_RTL (r, NULL);
 	DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
 	if (VAR_P (r))
 	  {
+	    SET_DECL_MODE (r, VOIDmode);
+
 	    /* Possibly limit visibility based on template args.  */
 	    DECL_VISIBILITY (r) = VISIBILITY_DEFAULT;
 	    if (DECL_VISIBILITY_SPECIFIED (t))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-19 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 14:21 [C++ PATCH] small pt.c cleanup Nathan Sidwell

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).