FreeBSD/contrib/gcc/varasm.c
/* Determine what kind of relocations EXP may need.  */
Determine what kind of relocations EXP may need.
Determine what kind of relocations EXP may need .
int
compute_reloc_for_constant (tree exp)
{
  int reloc = 0, reloc2;
  tree tem;
  exp = lang_hooks.expand_constant (exp);
  switch (TREE_CODE (exp))
    {
    case ADDR_EXPR:
    case FDESC_EXPR:
      for (tem = TREE_OPERAND (exp, 0); handled_component_p (tem);
	   tem = TREE_OPERAND (tem, 0))
	;
      if (TREE_PUBLIC (tem))
	reloc |= 2;
      else
	reloc |= 1;
      break;
    case PLUS_EXPR:
      reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
      reloc |= compute_reloc_for_constant (TREE_OPERAND (exp, 1));
      break;
    case MINUS_EXPR:
      reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
      reloc2 = compute_reloc_for_constant (TREE_OPERAND (exp, 1));
      if (reloc == 1 && reloc2 == 1)
	reloc = 0;
      else
	reloc |= reloc2;
      break;
    case NOP_EXPR:
    case CONVERT_EXPR:
    case NON_LVALUE_EXPR:
    case VIEW_CONVERT_EXPR:
      reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
      break;
    case CONSTRUCTOR:
      {
	unsigned HOST_WIDE_INT idx;
	FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, tem)
	  if (tem != 0)
	    reloc |= compute_reloc_for_constant (tem);
      }
      break;
    default:
      break;
    }
  return reloc;
}
int compute_reloc_for_constant ( tree exp ) { int reloc = 0 , reloc2 ; tree tem ; exp = lang_hooks . expand_constant ( exp ) ; switch ( TREE_CODE ( exp ) ) { case ADDR_EXPR : case FDESC_EXPR : for ( tem = TREE_OPERAND ( exp , 0 ) ; handled_component_p ( tem ) ; tem = TREE_OPERAND ( tem , 0 ) ) ; if ( TREE_PUBLIC ( tem ) ) reloc |= 2 ; else reloc |= 1 ; break ; case PLUS_EXPR : reloc = compute_reloc_for_constant ( TREE_OPERAND ( exp , 0 ) ) ; reloc |= compute_reloc_for_constant ( TREE_OPERAND ( exp , 1 ) ) ; break ; case MINUS_EXPR : reloc = compute_reloc_for_constant ( TREE_OPERAND ( exp , 0 ) ) ; reloc2 = compute_reloc_for_constant ( TREE_OPERAND ( exp , 1 ) ) ; if ( reloc == 1 && reloc2 == 1 ) reloc = 0 ; else reloc |= reloc2 ; break ; case NOP_EXPR : case CONVERT_EXPR : case NON_LVALUE_EXPR : case VIEW_CONVERT_EXPR : reloc = compute_reloc_for_constant ( TREE_OPERAND ( exp , 0 ) ) ; break ; case CONSTRUCTOR : { unsigned HOST_WIDE_INT idx ; FOR_EACH_CONSTRUCTOR_VALUE ( CONSTRUCTOR_ELTS ( exp ) , idx , tem ) if ( tem != 0 ) reloc |= compute_reloc_for_constant ( tem ) ; } break ; default : break ; } return reloc ; }
Determine what kind of relocations EXP may need.
Determine what kind of relocations EXP may need .
/* Give the front-end a chance to convert VALUE to something that
     looks more like a constant to the back-end.  */ /* Go inside any operations that get_inner_reference can handle and see
	 if what's inside is a constant: no need to do anything here for
	 addresses of variables or functions.  */ /* The difference of two local labels is computable at link time.  */