FreeBSD/contrib/gcc/cp/method.c
/* Synthesize FNDECL, a non-static member function.   */
Synthesize FNDECL, a non-static member function.
Synthesize FNDECL a non - static member function .
void
synthesize_method (tree fndecl)
{
  bool nested = (current_function_decl != NULL_TREE);
  tree context = decl_function_context (fndecl);
  bool need_body = true;
  tree stmt;
  location_t save_input_location = input_location;
  int error_count = errorcount;
  int warning_count = warningcount;
  DECL_SOURCE_LOCATION (fndecl)
    = DECL_SOURCE_LOCATION (TYPE_NAME (DECL_CONTEXT (fndecl)));
  if (DECL_CLONED_FUNCTION_P (fndecl))
    fndecl = DECL_CLONED_FUNCTION (fndecl);
  push_deferring_access_checks (dk_no_deferred);
  if (! context)
    push_to_top_level ();
  else if (nested)
    push_function_context_to (context);
  input_location = DECL_SOURCE_LOCATION (fndecl);
  start_preparsed_function (fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED);
  stmt = begin_function_body ();
  if (DECL_OVERLOADED_OPERATOR_P (fndecl) == NOP_EXPR)
    {
      do_build_assign_ref (fndecl);
      need_body = false;
    }
  else if (DECL_CONSTRUCTOR_P (fndecl))
    {
      tree arg_chain = FUNCTION_FIRST_USER_PARMTYPE (fndecl);
      if (arg_chain != void_list_node)
	do_build_copy_constructor (fndecl);
      else
	finish_mem_initializers (NULL_TREE);
    }
  if (need_body)
    {
      tree compound_stmt;
      compound_stmt = begin_compound_stmt (BCS_FN_BODY);
      finish_compound_stmt (compound_stmt);
    }
  finish_function_body (stmt);
  expand_or_defer_fn (finish_function (0));
  input_location = save_input_location;
  if (! context)
    pop_from_top_level ();
  else if (nested)
    pop_function_context_from (context);
  pop_deferring_access_checks ();
  if (error_count != errorcount || warning_count != warningcount)
    inform ("%Hsynthesized method %qD first required here ",
	    &input_location, fndecl);
}
void synthesize_method ( tree fndecl ) { bool nested = ( current_function_decl != NULL_TREE ) ; tree context = decl_function_context ( fndecl ) ; bool need_body = true ; tree stmt ; location_t save_input_location = input_location ; int error_count = errorcount ; int warning_count = warningcount ; DECL_SOURCE_LOCATION ( fndecl ) = DECL_SOURCE_LOCATION ( TYPE_NAME ( DECL_CONTEXT ( fndecl ) ) ) ; if ( DECL_CLONED_FUNCTION_P ( fndecl ) ) fndecl = DECL_CLONED_FUNCTION ( fndecl ) ; push_deferring_access_checks ( dk_no_deferred ) ; if ( ! context ) push_to_top_level ( ) ; else if ( nested ) push_function_context_to ( context ) ; input_location = DECL_SOURCE_LOCATION ( fndecl ) ; start_preparsed_function ( fndecl , NULL_TREE , SF_DEFAULT | SF_PRE_PARSED ) ; stmt = begin_function_body ( ) ; if ( DECL_OVERLOADED_OPERATOR_P ( fndecl ) == NOP_EXPR ) { do_build_assign_ref ( fndecl ) ; need_body = false ; } else if ( DECL_CONSTRUCTOR_P ( fndecl ) ) { tree arg_chain = FUNCTION_FIRST_USER_PARMTYPE ( fndecl ) ; if ( arg_chain != void_list_node ) do_build_copy_constructor ( fndecl ) ; else finish_mem_initializers ( NULL_TREE ) ; } if ( need_body ) { tree compound_stmt ; compound_stmt = begin_compound_stmt ( BCS_FN_BODY ) ; finish_compound_stmt ( compound_stmt ) ; } finish_function_body ( stmt ) ; expand_or_defer_fn ( finish_function ( 0 ) ) ; input_location = save_input_location ; if ( ! context ) pop_from_top_level ( ) ; else if ( nested ) pop_function_context_from ( context ) ; pop_deferring_access_checks ( ) ; if ( error_count != errorcount || warning_count != warningcount ) inform ( " " , & input_location , fndecl ) ; }
Synthesize FNDECL, a non-static member function.
Synthesize FNDECL a non - static member function .
/* Reset the source location, we might have been previously
     deferred, and thus have saved where we were first needed.  */ /* If we've been asked to synthesize a clone, just synthesize the
     cloned function instead.  Doing so will automatically fill in the
     body for the clone.  */ /* We may be in the middle of deferred access check.  Disable
     it now.  */ /* If we haven't yet generated the body of the function, just
     generate an empty compound statement.  */