FreeBSD/contrib/gcc/cp/decl.c
/* Generate code to initialize DECL (a local variable).  */
Generate code to initialize DECL (a local variable).
Generate code to initialize DECL ( a local variable ) .
static void
initialize_local_var (tree decl, tree init)
{
  tree type = TREE_TYPE (decl);
  tree cleanup;
  gcc_assert (TREE_CODE (decl) == VAR_DECL
	      || TREE_CODE (decl) == RESULT_DECL);
  gcc_assert (!TREE_STATIC (decl));
  if (DECL_SIZE (decl) == NULL_TREE)
    {
      DECL_INITIAL (decl) = NULL_TREE;
      TREE_ADDRESSABLE (decl) = TREE_USED (decl);
    }
  if (DECL_SIZE (decl) && type != error_mark_node)
    {
      int already_used;
      already_used = TREE_USED (decl) || TREE_USED (type);
      if (init)
	{
	  int saved_stmts_are_full_exprs_p;
	  gcc_assert (building_stmt_tree ());
	  saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
	  current_stmt_tree ()->stmts_are_full_exprs_p = 1;
	  finish_expr_stmt (init);
	  current_stmt_tree ()->stmts_are_full_exprs_p =
	    saved_stmts_are_full_exprs_p;
	}
      if (TYPE_NEEDS_CONSTRUCTING (type)
	  && ! already_used
	  && TYPE_HAS_TRIVIAL_DESTRUCTOR (type)
	  && DECL_NAME (decl))
	TREE_USED (decl) = 0;
      else if (already_used)
	TREE_USED (decl) = 1;
    }
  cleanup = cxx_maybe_build_cleanup (decl);
  if (DECL_SIZE (decl) && cleanup)
    finish_decl_cleanup (decl, cleanup);
}
static void initialize_local_var ( tree decl , tree init ) { tree type = TREE_TYPE ( decl ) ; tree cleanup ; gcc_assert ( TREE_CODE ( decl ) == VAR_DECL || TREE_CODE ( decl ) == RESULT_DECL ) ; gcc_assert ( ! TREE_STATIC ( decl ) ) ; if ( DECL_SIZE ( decl ) == NULL_TREE ) { DECL_INITIAL ( decl ) = NULL_TREE ; TREE_ADDRESSABLE ( decl ) = TREE_USED ( decl ) ; } if ( DECL_SIZE ( decl ) && type != error_mark_node ) { int already_used ; already_used = TREE_USED ( decl ) || TREE_USED ( type ) ; if ( init ) { int saved_stmts_are_full_exprs_p ; gcc_assert ( building_stmt_tree ( ) ) ; saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ( ) ; current_stmt_tree ( ) -> stmts_are_full_exprs_p = 1 ; finish_expr_stmt ( init ) ; current_stmt_tree ( ) -> stmts_are_full_exprs_p = saved_stmts_are_full_exprs_p ; } if ( TYPE_NEEDS_CONSTRUCTING ( type ) && ! already_used && TYPE_HAS_TRIVIAL_DESTRUCTOR ( type ) && DECL_NAME ( decl ) ) TREE_USED ( decl ) = 0 ; else if ( already_used ) TREE_USED ( decl ) = 1 ; } cleanup = cxx_maybe_build_cleanup ( decl ) ; if ( DECL_SIZE ( decl ) && cleanup ) finish_decl_cleanup ( decl , cleanup ) ; }
Generate code to initialize DECL (a local variable).
Generate code to initialize DECL ( a local variable ) .
/* If we used it already as memory, it must stay in memory.  */ /* Compute and store the initial value.  */ /* Perform the initialization.  */ /* Set this to 0 so we can tell whether an aggregate which was
	 initialized was ever used.  Don't do this if it has a
	 destructor, so we don't complain about the 'resource
	 allocation is initialization' idiom.  Now set
	 attribute((unused)) on types so decls of that type will be
	 marked used. (see TREE_USED, above.)  */ /* Generate a cleanup, if necessary.  */