diff mbox

[tree-type] Remove variables name ttype in preparation for changing the type from tree_type_ptr to ttype

Message ID 547CA653.2060608@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod Dec. 1, 2014, 5:33 p.m. UTC
Changes a few files where ttype is used as a variable.   The next patch 
changes the branch to use ttype as the name instead of tree_type_ptr.

bootstraps, run tests, etc.
checked into branch.

Andrew
diff mbox

Patch


	* builtins.c (fold_builtin_atomic_always_lock_free): Don't use ttype as
	a variable name.
	* config/sol2-c.c (solaris_pragma_align, solaris_pragma_init,
	solaris_pragma_fini): Likewise.
	* cp/decl.c (layout_var_decl): Likewise.
	* cp/error.c (dump_expr): Likewise.
	* lto-streamer-in.c (input_eh_regions): Likewise.
	* lto-streamer-out.c (output_eh_regions): Likewise.
	* tree.c (build_type_attribute_qual_variant): Likewise.
	(build_type_attribute_variant): Likewise.


Index: builtins.c
===================================================================
*** builtins.c	(revision 218211)
--- builtins.c	(working copy)
*************** fold_builtin_atomic_always_lock_free (tr
*** 5679,5700 ****
      type_align = mode_align;
    else
      {
!       tree ttype = TREE_TYPE (arg1);
  
        /* This function is usually invoked and folded immediately by the front
  	 end before anything else has a chance to look at it.  The pointer
  	 parameter at this point is usually cast to a void *, so check for that
  	 and look past the cast.  */
!       if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (ttype)
! 	  && VOID_TYPE_P (TREE_TYPE (ttype)))
  	arg1 = TREE_OPERAND (arg1, 0);
  
!       ttype = TREE_TYPE (arg1);
!       gcc_assert (POINTER_TYPE_P (ttype));
  
        /* Get the underlying type of the object.  */
!       ttype = TREE_TYPE (ttype);
!       type_align = TYPE_ALIGN (ttype);
      }
  
    /* If the object has smaller alignment, the the lock free routines cannot
--- 5679,5700 ----
      type_align = mode_align;
    else
      {
!       tree type = TREE_TYPE (arg1);
  
        /* This function is usually invoked and folded immediately by the front
  	 end before anything else has a chance to look at it.  The pointer
  	 parameter at this point is usually cast to a void *, so check for that
  	 and look past the cast.  */
!       if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (type)
! 	  && VOID_TYPE_P (TREE_TYPE (type)))
  	arg1 = TREE_OPERAND (arg1, 0);
  
!       type = TREE_TYPE (arg1);
!       gcc_assert (POINTER_TYPE_P (type));
  
        /* Get the underlying type of the object.  */
!       type = TREE_TYPE (type);
!       type_align = TYPE_ALIGN (type);
      }
  
    /* If the object has smaller alignment, the the lock free routines cannot
Index: config/sol2-c.c
===================================================================
*** config/sol2-c.c	(revision 218211)
--- config/sol2-c.c	(working copy)
*************** static void
*** 85,91 ****
  solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t, x;
!   enum cpp_ttype ttype;
    unsigned HOST_WIDE_INT low;
  
    if (pragma_lex (&x) != CPP_NUMBER
--- 85,91 ----
  solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t, x;
!   enum cpp_tok_type tok_type;
    unsigned HOST_WIDE_INT low;
  
    if (pragma_lex (&x) != CPP_NUMBER
*************** solaris_pragma_align (cpp_reader *pfile
*** 104,111 ****
        return;
      }
  
!   ttype = pragma_lex (&t);
!   if (ttype != CPP_NAME)
      {
        warning (0, "malformed %<#pragma align%>, ignoring");
        return;
--- 104,111 ----
        return;
      }
  
!   tok_type = pragma_lex (&t);
!   if (tok_type != CPP_NAME)
      {
        warning (0, "malformed %<#pragma align%>, ignoring");
        return;
*************** solaris_pragma_align (cpp_reader *pfile
*** 121,137 ****
  	solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
  					    solaris_pending_aligns);
  
!       ttype = pragma_lex (&t);
!       if (ttype == CPP_COMMA)
  	{
! 	  ttype = pragma_lex (&t);
! 	  if (ttype != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma align%>");
  	      return;
  	    }
  	}
!       else if (ttype == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma align%>");
--- 121,137 ----
  	solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
  					    solaris_pending_aligns);
  
!       tok_type = pragma_lex (&t);
!       if (tok_type == CPP_COMMA)
  	{
! 	  tok_type = pragma_lex (&t);
! 	  if (tok_type != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma align%>");
  	      return;
  	    }
  	}
!       else if (tok_type == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma align%>");
*************** static void
*** 151,157 ****
  solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t;
!   enum cpp_ttype ttype;
  
    if (pragma_lex (&t) != CPP_OPEN_PAREN)
      {
--- 151,157 ----
  solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t;
!   enum cpp_tok_type tok_type;
  
    if (pragma_lex (&t) != CPP_OPEN_PAREN)
      {
*************** solaris_pragma_init (cpp_reader *pfile A
*** 159,166 ****
        return;
      }
  
!   ttype = pragma_lex (&t);
!   if (ttype != CPP_NAME)
      {
        warning (0, "malformed %<#pragma init%>, ignoring");
        return;
--- 159,166 ----
        return;
      }
  
!   tok_type = pragma_lex (&t);
!   if (tok_type != CPP_NAME)
      {
        warning (0, "malformed %<#pragma init%>, ignoring");
        return;
*************** solaris_pragma_init (cpp_reader *pfile A
*** 180,196 ****
        else
  	solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits);
  
!       ttype = pragma_lex (&t);
!       if (ttype == CPP_COMMA)
  	{
! 	  ttype = pragma_lex (&t);
! 	  if (ttype != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma init%>");
  	      return;
  	    }
  	}
!       else if (ttype == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma init%>");
--- 180,196 ----
        else
  	solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits);
  
!       tok_type = pragma_lex (&t);
!       if (tok_type == CPP_COMMA)
  	{
! 	  tok_type = pragma_lex (&t);
! 	  if (tok_type != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma init%>");
  	      return;
  	    }
  	}
!       else if (tok_type == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma init%>");
*************** static void
*** 210,216 ****
  solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t;
!   enum cpp_ttype ttype;
  
    if (pragma_lex (&t) != CPP_OPEN_PAREN)
      {
--- 210,216 ----
  solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
  {
    tree t;
!   enum cpp_tok_type tok_type;
  
    if (pragma_lex (&t) != CPP_OPEN_PAREN)
      {
*************** solaris_pragma_fini (cpp_reader *pfile A
*** 218,225 ****
        return;
      }
  
!   ttype = pragma_lex (&t);
!   if (ttype != CPP_NAME)
      {
        warning (0, "malformed %<#pragma fini%>, ignoring");
        return;
--- 218,225 ----
        return;
      }
  
!   tok_type = pragma_lex (&t);
!   if (tok_type != CPP_NAME)
      {
        warning (0, "malformed %<#pragma fini%>, ignoring");
        return;
*************** solaris_pragma_fini (cpp_reader *pfile A
*** 239,255 ****
        else
  	solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis);
  
!       ttype = pragma_lex (&t);
!       if (ttype == CPP_COMMA)
  	{
! 	  ttype = pragma_lex (&t);
! 	  if (ttype != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma fini%>");
  	      return;
  	    }
  	}
!       else if (ttype == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma fini%>");
--- 239,255 ----
        else
  	solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis);
  
!       tok_type = pragma_lex (&t);
!       if (tok_type == CPP_COMMA)
  	{
! 	  tok_type = pragma_lex (&t);
! 	  if (tok_type != CPP_NAME)
  	    {
  	      warning (0, "malformed %<#pragma fini%>");
  	      return;
  	    }
  	}
!       else if (tok_type == CPP_CLOSE_PAREN)
  	{
  	  if (pragma_lex (&t) != CPP_EOF)
  	    warning (0, "junk at end of %<#pragma fini%>");
Index: cp/decl.c
===================================================================
*** cp/decl.c	(revision 218211)
--- cp/decl.c	(working copy)
*************** layout_var_decl (tree decl)
*** 5081,5089 ****
    /* Keep this code around in case we later want to control debug info
       based on whether a type is "used".  (jason 1999-11-11) */
  
!   else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (ttype))
      /* Let debugger know it should output info for this type.  */
!     note_debug_info_needed (ttype);
  
    if (TREE_STATIC (decl) && DECL_CLASS_SCOPE_P (decl))
      note_debug_info_needed (DECL_CONTEXT (decl));
--- 5081,5089 ----
    /* Keep this code around in case we later want to control debug info
       based on whether a type is "used".  (jason 1999-11-11) */
  
!   else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (type))
      /* Let debugger know it should output info for this type.  */
!     note_debug_info_needed (type);
  
    if (TREE_STATIC (decl) && DECL_CLASS_SCOPE_P (decl))
      note_debug_info_needed (DECL_CONTEXT (decl));
Index: cp/error.c
===================================================================
*** cp/error.c	(revision 218211)
--- cp/error.c	(working copy)
*************** dump_expr (cxx_pretty_printer *pp, tree
*** 2291,2306 ****
      case VIEW_CONVERT_EXPR:
        {
  	tree op = TREE_OPERAND (t, 0);
! 	tree ttype = TREE_TYPE (t);
  	tree optype = TREE_TYPE (op);
  
! 	if (TREE_CODE (ttype) != TREE_CODE (optype)
! 	    && POINTER_TYPE_P (ttype)
  	    && POINTER_TYPE_P (optype)
  	    && same_type_p (TREE_TYPE (optype),
! 			    TREE_TYPE (ttype)))
  	  {
! 	    if (TREE_CODE (ttype) == REFERENCE_TYPE)
  	      {
  		STRIP_NOPS (op);
  		if (TREE_CODE (op) == ADDR_EXPR)
--- 2291,2306 ----
      case VIEW_CONVERT_EXPR:
        {
  	tree op = TREE_OPERAND (t, 0);
! 	tree type = TREE_TYPE (t);
  	tree optype = TREE_TYPE (op);
  
! 	if (TREE_CODE (type) != TREE_CODE (optype)
! 	    && POINTER_TYPE_P (type)
  	    && POINTER_TYPE_P (optype)
  	    && same_type_p (TREE_TYPE (optype),
! 			    TREE_TYPE (type)))
  	  {
! 	    if (TREE_CODE (type) == REFERENCE_TYPE)
  	      {
  		STRIP_NOPS (op);
  		if (TREE_CODE (op) == ADDR_EXPR)
Index: lto-streamer-in.c
===================================================================
*** lto-streamer-in.c	(revision 218211)
--- lto-streamer-in.c	(working copy)
*************** input_eh_regions (struct lto_input_block
*** 551,558 ****
        vec_safe_grow_cleared (fn->eh->ttype_data, len);
        for (i = 0; i < len; i++)
  	{
! 	  tree ttype = stream_read_tree (ib, data_in);
! 	  (*fn->eh->ttype_data)[i] = ttype;
  	}
      }
  
--- 551,558 ----
        vec_safe_grow_cleared (fn->eh->ttype_data, len);
        for (i = 0; i < len; i++)
  	{
! 	  tree type = stream_read_tree (ib, data_in);
! 	  (*fn->eh->ttype_data)[i] = type;
  	}
      }
  
Index: lto-streamer-out.c
===================================================================
*** lto-streamer-out.c	(revision 218211)
--- lto-streamer-out.c	(working copy)
*************** output_eh_regions (struct output_block *
*** 1691,1697 ****
        unsigned i;
        eh_region eh;
        eh_landing_pad lp;
!       tree ttype;
  
        streamer_write_record_start (ob, LTO_eh_table);
  
--- 1691,1697 ----
        unsigned i;
        eh_region eh;
        eh_landing_pad lp;
!       tree type;
  
        streamer_write_record_start (ob, LTO_eh_table);
  
*************** output_eh_regions (struct output_block *
*** 1710,1717 ****
  
        /* Emit all the runtime type data.  */
        streamer_write_hwi (ob, vec_safe_length (fn->eh->ttype_data));
!       FOR_EACH_VEC_SAFE_ELT (fn->eh->ttype_data, i, ttype)
! 	stream_write_tree (ob, ttype, true);
  
        /* Emit the table of action chains.  */
        if (targetm.arm_eabi_unwinder)
--- 1710,1717 ----
  
        /* Emit all the runtime type data.  */
        streamer_write_hwi (ob, vec_safe_length (fn->eh->ttype_data));
!       FOR_EACH_VEC_SAFE_ELT (fn->eh->ttype_data, i, type)
! 	stream_write_tree (ob, type, true);
  
        /* Emit the table of action chains.  */
        if (targetm.arm_eabi_unwinder)
Index: tree.c
===================================================================
*** tree.c	(revision 218211)
--- tree.c	(working copy)
*************** build_decl_attribute_variant (tree ddecl
*** 4658,4678 ****
    return ddecl;
  }
  
! /* Return a type like TTYPE except that its TYPE_ATTRIBUTE
     is ATTRIBUTE and its qualifiers are QUALS.
  
     Record such modified types already made so we don't make duplicates.  */
  
  tree
! build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
  {
!   if (! attribute_list_equal (TYPE_ATTRIBUTES (ttype), attribute))
      {
        inchash::hash hstate;
        tree ntype;
        int i;
        tree t;
!       enum tree_code code = TREE_CODE (ttype);
  
        /* Building a distinct copy of a tagged type is inappropriate; it
  	 causes breakage in code that expects there to be a one-to-one
--- 4658,4678 ----
    return ddecl;
  }
  
! /* Return a type like TYPE except that its TYPE_ATTRIBUTE
     is ATTRIBUTE and its qualifiers are QUALS.
  
     Record such modified types already made so we don't make duplicates.  */
  
  tree
! build_type_attribute_qual_variant (tree type, tree attribute, int quals)
  {
!   if (! attribute_list_equal (TYPE_ATTRIBUTES (type), attribute))
      {
        inchash::hash hstate;
        tree ntype;
        int i;
        tree t;
!       enum tree_code code = TREE_CODE (type);
  
        /* Building a distinct copy of a tagged type is inappropriate; it
  	 causes breakage in code that expects there to be a one-to-one
*************** build_type_attribute_qual_variant (tree
*** 4680,4698 ****
  	 build_duplicate_type is another solution (as used in
  	 handle_transparent_union_attribute), but that doesn't play well
  	 with the stronger C++ type identity model.  */
!       if (TREE_CODE (ttype) == RECORD_TYPE
! 	  || TREE_CODE (ttype) == UNION_TYPE
! 	  || TREE_CODE (ttype) == QUAL_UNION_TYPE
! 	  || TREE_CODE (ttype) == ENUMERAL_TYPE)
  	{
  	  warning (OPT_Wattributes,
  		   "ignoring attributes applied to %qT after definition",
! 		   TYPE_MAIN_VARIANT (ttype));
! 	  return build_qualified_type (ttype, quals);
  	}
  
!       ttype = build_qualified_type (ttype, TYPE_UNQUALIFIED);
!       ntype = build_distinct_type_copy (ttype);
  
        TYPE_ATTRIBUTES (ntype) = attribute;
  
--- 4680,4698 ----
  	 build_duplicate_type is another solution (as used in
  	 handle_transparent_union_attribute), but that doesn't play well
  	 with the stronger C++ type identity model.  */
!       if (TREE_CODE (type) == RECORD_TYPE
! 	  || TREE_CODE (type) == UNION_TYPE
! 	  || TREE_CODE (type) == QUAL_UNION_TYPE
! 	  || TREE_CODE (type) == ENUMERAL_TYPE)
  	{
  	  warning (OPT_Wattributes,
  		   "ignoring attributes applied to %qT after definition",
! 		   TYPE_MAIN_VARIANT (type));
! 	  return build_qualified_type (type, quals);
  	}
  
!       type = build_qualified_type (type, TYPE_UNQUALIFIED);
!       ntype = build_distinct_type_copy (type);
  
        TYPE_ATTRIBUTES (ntype) = attribute;
  
*************** build_type_attribute_qual_variant (tree
*** 4731,4748 ****
        /* If the target-dependent attributes make NTYPE different from
  	 its canonical type, we will need to use structural equality
  	 checks for this type. */
!       if (TYPE_STRUCTURAL_EQUALITY_P (ttype)
!           || !comp_type_attributes (ntype, ttype))
  	SET_TYPE_STRUCTURAL_EQUALITY (ntype);
        else if (TYPE_CANONICAL (ntype) == ntype)
! 	TYPE_CANONICAL (ntype) = TYPE_CANONICAL (ttype);
  
!       ttype = build_qualified_type (ntype, quals);
      }
!   else if (TYPE_QUALS (ttype) != quals)
!     ttype = build_qualified_type (ttype, quals);
  
!   return ttype;
  }
  
  /* Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are
--- 4731,4748 ----
        /* If the target-dependent attributes make NTYPE different from
  	 its canonical type, we will need to use structural equality
  	 checks for this type. */
!       if (TYPE_STRUCTURAL_EQUALITY_P (type)
!           || !comp_type_attributes (ntype, type))
  	SET_TYPE_STRUCTURAL_EQUALITY (ntype);
        else if (TYPE_CANONICAL (ntype) == ntype)
! 	TYPE_CANONICAL (ntype) = TYPE_CANONICAL (type);
  
!       type = build_qualified_type (ntype, quals);
      }
!   else if (TYPE_QUALS (type) != quals)
!     type = build_qualified_type (type, quals);
  
!   return type;
  }
  
  /* Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are
*************** comp_type_attributes (const_tree type1,
*** 4888,4897 ****
     Record such modified types already made so we don't make duplicates.  */
  
  tree
! build_type_attribute_variant (tree ttype, tree attribute)
  {
!   return build_type_attribute_qual_variant (ttype, attribute,
! 					    TYPE_QUALS (ttype));
  }
  
  
--- 4888,4897 ----
     Record such modified types already made so we don't make duplicates.  */
  
  tree
! build_type_attribute_variant (tree type, tree attribute)
  {
!   return build_type_attribute_qual_variant (type, attribute,
! 					    TYPE_QUALS (type));
  }