FreeBSD/contrib/gcc/cp/typeck.c
/* Mark EXP saying that we need to be able to take the
   address of it; it should not be allocated in a register.
   Value is true if successful.

   C++: we do not allow `current_class_ptr' to be addressable.  */
Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
Value is true if successful.

C++: we do not allow `current_class_ptr' to be addressable.
Mark EXP saying that we need to be able to take the address of it ; it should not be allocated in a register . Value is true if successful . C ++ : we do not allow ` current_class_ptr ' to be addressable .
bool
cxx_mark_addressable (tree exp)
{
  tree x = exp;
  while (1)
    switch (TREE_CODE (x))
      {
      case ADDR_EXPR:
      case COMPONENT_REF:
      case ARRAY_REF:
      case REALPART_EXPR:
      case IMAGPART_EXPR:
	x = TREE_OPERAND (x, 0);
	break;
      case PARM_DECL:
	if (x == current_class_ptr)
	  {
	    error ("cannot take the address of %<this%>, which is an rvalue expression");
	    TREE_ADDRESSABLE (x) = 1; 
	    return true;
	  }
      case VAR_DECL:
	gcc_assert (DECL_LANG_SPECIFIC (x) == 0
		    || DECL_IN_AGGR_P (x) == 0
		    || TREE_STATIC (x)
		    || DECL_EXTERNAL (x));
      case CONST_DECL:
      case RESULT_DECL:
	if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
	    && !DECL_ARTIFICIAL (x))
	  {
	    if (TREE_CODE (x) == VAR_DECL && DECL_HARD_REGISTER (x))
	      {
		error
		  ("address of explicit register variable %qD requested", x);
		return false;
	      }
	    else if (extra_warnings)
	      warning
		(OPT_Wextra, "address requested for %qD, which is declared %<register%>", x);
	  }
	TREE_ADDRESSABLE (x) = 1;
	return true;
      case FUNCTION_DECL:
	TREE_ADDRESSABLE (x) = 1;
	return true;
      case CONSTRUCTOR:
	TREE_ADDRESSABLE (x) = 1;
	return true;
      case TARGET_EXPR:
	TREE_ADDRESSABLE (x) = 1;
	cxx_mark_addressable (TREE_OPERAND (x, 0));
	return true;
      default:
	return true;
    }
}
bool cxx_mark_addressable ( tree exp ) { tree x = exp ; while ( 1 ) switch ( TREE_CODE ( x ) ) { case ADDR_EXPR : case COMPONENT_REF : case ARRAY_REF : case REALPART_EXPR : case IMAGPART_EXPR : x = TREE_OPERAND ( x , 0 ) ; break ; case PARM_DECL : if ( x == current_class_ptr ) { error ( " " ) ; TREE_ADDRESSABLE ( x ) = 1 ; return true ; } case VAR_DECL : gcc_assert ( DECL_LANG_SPECIFIC ( x ) == 0 || DECL_IN_AGGR_P ( x ) == 0 || TREE_STATIC ( x ) || DECL_EXTERNAL ( x ) ) ; case CONST_DECL : case RESULT_DECL : if ( DECL_REGISTER ( x ) && ! TREE_ADDRESSABLE ( x ) && ! DECL_ARTIFICIAL ( x ) ) { if ( TREE_CODE ( x ) == VAR_DECL && DECL_HARD_REGISTER ( x ) ) { error ( " " , x ) ; return false ; } else if ( extra_warnings ) warning ( OPT_Wextra , " " , x ) ; } TREE_ADDRESSABLE ( x ) = 1 ; return true ; case FUNCTION_DECL : TREE_ADDRESSABLE ( x ) = 1 ; return true ; case CONSTRUCTOR : TREE_ADDRESSABLE ( x ) = 1 ; return true ; case TARGET_EXPR : TREE_ADDRESSABLE ( x ) = 1 ; cxx_mark_addressable ( TREE_OPERAND ( x , 0 ) ) ; return true ; default : return true ; } }
Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
Mark EXP saying that we need to be able to take the address of it ; it should not be allocated in a register .
/* so compiler doesn't die later.  */ /* Fall through.  */ /* Caller should not be trying to mark initialized
	   constant fields addressable.  */ /* Fall through.  */