FreeBSD/contrib/gcc/cp/cp-gimplify.c
/* Perform any pre-gimplification lowering of C++ front end trees to
   GENERIC.  */
Perform any pre-gimplification lowering of C++ front end trees to
GENERIC.
Perform any pre - gimplification lowering of C ++ front end trees to GENERIC .
static tree
cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
{
  tree stmt = *stmt_p;
  struct pointer_set_t *p_set = (struct pointer_set_t*) data;
  if (is_invisiref_parm (stmt)
      && !(DECL_THUNK_P (current_function_decl)
	   && TREE_CODE (stmt) == PARM_DECL))
    {
      *stmt_p = convert_from_reference (stmt);
      *walk_subtrees = 0;
      return NULL;
    }
  if (cp_function_chain->extern_decl_map
      && (TREE_CODE (stmt) == FUNCTION_DECL || TREE_CODE (stmt) == VAR_DECL)
      && DECL_EXTERNAL (stmt))
    {
      struct cxx_int_tree_map *h, in;
      in.uid = DECL_UID (stmt);
      h = (struct cxx_int_tree_map *)
	  htab_find_with_hash (cp_function_chain->extern_decl_map,
			       &in, in.uid);
      if (h)
	{
	  *stmt_p = h->to;
	  *walk_subtrees = 0;
	  return NULL;
	}
    }
  if (pointer_set_contains (p_set, stmt))
    {
      *walk_subtrees = 0;
      return NULL_TREE;
    }
  if (TREE_CODE (stmt) == ADDR_EXPR
      && is_invisiref_parm (TREE_OPERAND (stmt, 0)))
    {
      *stmt_p = convert (TREE_TYPE (stmt), TREE_OPERAND (stmt, 0));
      *walk_subtrees = 0;
    }
  else if (TREE_CODE (stmt) == RETURN_EXPR
	   && TREE_OPERAND (stmt, 0)
	   && is_invisiref_parm (TREE_OPERAND (stmt, 0)))
    *walk_subtrees = 0;
  else if (TREE_CODE (stmt) == OMP_CLAUSE)
    switch (OMP_CLAUSE_CODE (stmt))
      {
      case OMP_CLAUSE_PRIVATE:
      case OMP_CLAUSE_SHARED:
      case OMP_CLAUSE_FIRSTPRIVATE:
      case OMP_CLAUSE_LASTPRIVATE:
      case OMP_CLAUSE_COPYIN:
      case OMP_CLAUSE_COPYPRIVATE:
	if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt)))
	  *walk_subtrees = 0;
	break;
      case OMP_CLAUSE_REDUCTION:
	gcc_assert (!is_invisiref_parm (OMP_CLAUSE_DECL (stmt)));
	break;
      default:
	break;
      }
  else if (IS_TYPE_OR_DECL_P (stmt))
    *walk_subtrees = 0;
  else if (TREE_CODE (stmt) == CLEANUP_STMT)
    *stmt_p = build2 (CLEANUP_EH_ONLY (stmt) ? TRY_CATCH_EXPR
					     : TRY_FINALLY_EXPR,
		      void_type_node,
		      CLEANUP_BODY (stmt),
		      CLEANUP_EXPR (stmt));
  pointer_set_insert (p_set, *stmt_p);
  return NULL;
}
static tree cp_genericize_r ( tree * stmt_p , int * walk_subtrees , void * data ) { tree stmt = * stmt_p ; struct pointer_set_t * p_set = ( struct pointer_set_t * ) data ; if ( is_invisiref_parm ( stmt ) && ! ( DECL_THUNK_P ( current_function_decl ) && TREE_CODE ( stmt ) == PARM_DECL ) ) { * stmt_p = convert_from_reference ( stmt ) ; * walk_subtrees = 0 ; return NULL ; } if ( cp_function_chain -> extern_decl_map && ( TREE_CODE ( stmt ) == FUNCTION_DECL || TREE_CODE ( stmt ) == VAR_DECL ) && DECL_EXTERNAL ( stmt ) ) { struct cxx_int_tree_map * h , in ; in . uid = DECL_UID ( stmt ) ; h = ( struct cxx_int_tree_map * ) htab_find_with_hash ( cp_function_chain -> extern_decl_map , & in , in . uid ) ; if ( h ) { * stmt_p = h -> to ; * walk_subtrees = 0 ; return NULL ; } } if ( pointer_set_contains ( p_set , stmt ) ) { * walk_subtrees = 0 ; return NULL_TREE ; } if ( TREE_CODE ( stmt ) == ADDR_EXPR && is_invisiref_parm ( TREE_OPERAND ( stmt , 0 ) ) ) { * stmt_p = convert ( TREE_TYPE ( stmt ) , TREE_OPERAND ( stmt , 0 ) ) ; * walk_subtrees = 0 ; } else if ( TREE_CODE ( stmt ) == RETURN_EXPR && TREE_OPERAND ( stmt , 0 ) && is_invisiref_parm ( TREE_OPERAND ( stmt , 0 ) ) ) * walk_subtrees = 0 ; else if ( TREE_CODE ( stmt ) == OMP_CLAUSE ) switch ( OMP_CLAUSE_CODE ( stmt ) ) { case OMP_CLAUSE_PRIVATE : case OMP_CLAUSE_SHARED : case OMP_CLAUSE_FIRSTPRIVATE : case OMP_CLAUSE_LASTPRIVATE : case OMP_CLAUSE_COPYIN : case OMP_CLAUSE_COPYPRIVATE : if ( is_invisiref_parm ( OMP_CLAUSE_DECL ( stmt ) ) ) * walk_subtrees = 0 ; break ; case OMP_CLAUSE_REDUCTION : gcc_assert ( ! is_invisiref_parm ( OMP_CLAUSE_DECL ( stmt ) ) ) ; break ; default : break ; } else if ( IS_TYPE_OR_DECL_P ( stmt ) ) * walk_subtrees = 0 ; else if ( TREE_CODE ( stmt ) == CLEANUP_STMT ) * stmt_p = build2 ( CLEANUP_EH_ONLY ( stmt ) ? TRY_CATCH_EXPR : TRY_FINALLY_EXPR , void_type_node , CLEANUP_BODY ( stmt ) , CLEANUP_EXPR ( stmt ) ) ; pointer_set_insert ( p_set , * stmt_p ) ; return NULL ; }
Perform any pre-gimplification lowering of C++ front end trees to
GENERIC.
Perform any pre - gimplification lowering of C ++ front end trees to GENERIC .
/* Don't dereference parms in a thunk, pass the references through. */ /* Map block scope extern declarations to visible declarations with the
     same name and type in outer scopes if any.  */ /* Other than invisiref parms, don't walk the same tree twice.  */ /* Don't dereference an invisiref RESULT_DECL inside a RETURN_EXPR.  */ /* Don't dereference an invisiref in OpenMP clauses.  */ /* Due to the way voidify_wrapper_expr is written, we don't get a chance
     to lower this construct before scanning it, so we need to lower these
     before doing anything else.  */