m3-sys/m3cc/gcc-apple/gcc/varasm.c
/* Make a copy of the whole tree structure for a constant.  This
   handles the same types of nodes that compare_constant handles.  */
Make a copy of the whole tree structure for a constant.  This
handles the same types of nodes that compare_constant handles.
Make a copy of the whole tree structure for a constant . This handles the same types of nodes that compare_constant handles .
static tree
copy_constant (tree exp)
{
  switch (TREE_CODE (exp))
    {
    case ADDR_EXPR:
      if (CONSTANT_CLASS_P (TREE_OPERAND (exp, 0)))
	return build1 (TREE_CODE (exp), TREE_TYPE (exp),
		       copy_constant (TREE_OPERAND (exp, 0)));
      else
	return copy_node (exp);
    case INTEGER_CST:
    case REAL_CST:
    case STRING_CST:
      return copy_node (exp);
    case COMPLEX_CST:
      return build_complex (TREE_TYPE (exp),
			    copy_constant (TREE_REALPART (exp)),
			    copy_constant (TREE_IMAGPART (exp)));
    case PLUS_EXPR:
    case MINUS_EXPR:
      return build2 (TREE_CODE (exp), TREE_TYPE (exp),
		     copy_constant (TREE_OPERAND (exp, 0)),
		     copy_constant (TREE_OPERAND (exp, 1)));
    case NOP_EXPR:
    case CONVERT_EXPR:
    case NON_LVALUE_EXPR:
    case VIEW_CONVERT_EXPR:
      return build1 (TREE_CODE (exp), TREE_TYPE (exp),
		     copy_constant (TREE_OPERAND (exp, 0)));
    case CONSTRUCTOR:
      {
	tree copy = copy_node (exp);
	VEC(constructor_elt, gc) *v;
	unsigned HOST_WIDE_INT idx;
	tree purpose, value;
	v = VEC_alloc(constructor_elt, gc, VEC_length(constructor_elt,
						      CONSTRUCTOR_ELTS (exp)));
	FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), idx, purpose, value)
	  {
	    constructor_elt *ce = VEC_quick_push (constructor_elt, v, NULL);
	    ce->index = purpose;
	    ce->value = copy_constant (value);
	  }
	CONSTRUCTOR_ELTS (copy) = v;
	return copy;
      }
    default:
      {
	tree t = lang_hooks.expand_constant (exp);
	gcc_assert (t != exp);
	return copy_constant (t);
      }
    }
}
static tree copy_constant ( tree exp ) { switch ( TREE_CODE ( exp ) ) { case ADDR_EXPR : if ( CONSTANT_CLASS_P ( TREE_OPERAND ( exp , 0 ) ) ) return build1 ( TREE_CODE ( exp ) , TREE_TYPE ( exp ) , copy_constant ( TREE_OPERAND ( exp , 0 ) ) ) ; else return copy_node ( exp ) ; case INTEGER_CST : case REAL_CST : case STRING_CST : return copy_node ( exp ) ; case COMPLEX_CST : return build_complex ( TREE_TYPE ( exp ) , copy_constant ( TREE_REALPART ( exp ) ) , copy_constant ( TREE_IMAGPART ( exp ) ) ) ; case PLUS_EXPR : case MINUS_EXPR : return build2 ( TREE_CODE ( exp ) , TREE_TYPE ( exp ) , copy_constant ( TREE_OPERAND ( exp , 0 ) ) , copy_constant ( TREE_OPERAND ( exp , 1 ) ) ) ; case NOP_EXPR : case CONVERT_EXPR : case NON_LVALUE_EXPR : case VIEW_CONVERT_EXPR : return build1 ( TREE_CODE ( exp ) , TREE_TYPE ( exp ) , copy_constant ( TREE_OPERAND ( exp , 0 ) ) ) ; case CONSTRUCTOR : { tree copy = copy_node ( exp ) ; VEC ( constructor_elt , gc ) * v ; unsigned HOST_WIDE_INT idx ; tree purpose , value ; v = VEC_alloc ( constructor_elt , gc , VEC_length ( constructor_elt , CONSTRUCTOR_ELTS ( exp ) ) ) ; FOR_EACH_CONSTRUCTOR_ELT ( CONSTRUCTOR_ELTS ( exp ) , idx , purpose , value ) { constructor_elt * ce = VEC_quick_push ( constructor_elt , v , NULL ) ; ce -> index = purpose ; ce -> value = copy_constant ( value ) ; } CONSTRUCTOR_ELTS ( copy ) = v ; return copy ; } default : { tree t = lang_hooks . expand_constant ( exp ) ; gcc_assert ( t != exp ) ; return copy_constant ( t ) ; } } }
Make a copy of the whole tree structure for a constant.
Make a copy of the whole tree structure for a constant .
/* For ADDR_EXPR, we do not want to copy the decl whose address
	 is requested.  We do want to copy constants though.  */