- int name_specified = name != 0;
-
- if (dump_base_name == 0)
- dump_base_name = name ? name : "gccdump";
-
- if (! quiet_flag)
- time_report = 1;
-
- /* Start timing total execution time. */
-
- init_timevar ();
- timevar_start (TV_TOTAL);
-
- /* Open assembler code output file. Do this even if -fsyntax-only is on,
- because then the driver will have provided the name of a temporary
- file or bit bucket for us. */
-
- if (! name_specified && asm_file_name == 0)
- asm_out_file = stdout;
- else
- {
- if (asm_file_name == 0)
- {
- int len = strlen (dump_base_name);
- char *dumpname = (char *) xmalloc (len + 6);
- memcpy (dumpname, dump_base_name, len + 1);
- strip_off_ending (dumpname, len);
- strcat (dumpname, ".s");
- asm_file_name = dumpname;
- }
- if (!strcmp (asm_file_name, "-"))
- asm_out_file = stdout;
- else
- asm_out_file = fopen (asm_file_name, "w");
- if (asm_out_file == 0)
- fatal_io_error ("can't open %s for writing", asm_file_name);
- }
-
- /* Initialize data in various passes. */
-
- init_obstacks ();
- name = init_parse (name);
- init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
- || debug_info_level == DINFO_LEVEL_VERBOSE
- || flag_test_coverage
- || warn_notreached);
- init_regs ();
- init_alias_once ();
- init_decl_processing ();
- init_eh ();
- init_optabs ();
- init_stmt ();
- init_loop ();
- init_reload ();
- init_function_once ();
- init_stor_layout_once ();
- init_varasm_once ();
- init_EXPR_INSN_LIST_cache ();
-
- /* The following initialization functions need to generate rtl, so
- provide a dummy function context for them. */
- init_dummy_function_start ();
- init_expmed ();
- init_expr_once ();
- if (flag_caller_saves)
- init_caller_save ();
- expand_dummy_function_end ();
-
- /* If auxiliary info generation is desired, open the output file.
- This goes in the same directory as the source file--unlike
- all the other output files. */
- if (flag_gen_aux_info)
- {
- aux_info_file = fopen (aux_info_file_name, "w");
- if (aux_info_file == 0)
- fatal_io_error ("can't open %s", aux_info_file_name);
- }
-
-#ifdef IO_BUFFER_SIZE
- setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
- _IOFBF, IO_BUFFER_SIZE);
-#endif
-
- if (name != 0)
- name = ggc_strdup (name);
-
- input_filename = name;
-
- /* Put an entry on the input file stack for the main input file. */
- push_srcloc (input_filename, 0);
-
- /* Perform language-specific initialization.
- This may set main_input_filename. */
- if (lang_hooks.init)
- (*lang_hooks.init) ();
-
- /* If the input doesn't start with a #line, use the input name
- as the official input file name. */
- if (main_input_filename == 0)
- main_input_filename = name;
-
- if (flag_syntax_only)
- {
- write_symbols = NO_DEBUG;
- profile_flag = 0;
- profile_block_flag = 0;
- }
- else
- {
-#ifdef ASM_FILE_START
- ASM_FILE_START (asm_out_file);
-#endif
-
-#ifdef ASM_COMMENT_START
- if (flag_verbose_asm)
- {
- /* Print the list of options in effect. */
- print_version (asm_out_file, ASM_COMMENT_START);
- print_switch_values (asm_out_file, 0, MAX_LINE,
- ASM_COMMENT_START, " ", "\n");
- /* Add a blank line here so it appears in assembler output but not
- screen output. */
- fprintf (asm_out_file, "\n");
- }
-#endif
- } /* ! flag_syntax_only */
-
- /* Set up the debug hooks based on write_symbols. Default to doing
- nothing. */
- debug_hooks = &do_nothing_debug_hooks;
-#if defined(DBX_DEBUGGING_INFO)
- if (write_symbols == DBX_DEBUG)
- debug_hooks = &dbx_debug_hooks;
-#endif
-#if defined(XCOFF_DEBUGGING_INFO)
- if (write_symbols == XCOFF_DEBUG)
- debug_hooks = &xcoff_debug_hooks;
-#endif
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG)
- debug_hooks = &sdb_debug_hooks;
-#endif
-#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
- debug_hooks = &dwarf_debug_hooks;
-#endif
-#ifdef DWARF2_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
- debug_hooks = &dwarf2_debug_hooks;
-#endif
-
-#ifndef ASM_OUTPUT_SECTION_NAME
- if (flag_function_sections)
- {
- warning ("-ffunction-sections not supported for this target.");
- flag_function_sections = 0;
- }
- if (flag_data_sections)
- {
- warning ("-fdata-sections not supported for this target.");
- flag_data_sections = 0;
- }
-#endif
-
- if (flag_function_sections
- && (profile_flag || profile_block_flag))
- {
- warning ("-ffunction-sections disabled; it makes profiling impossible.");
- flag_function_sections = 0;
- }
-
-#ifndef OBJECT_FORMAT_ELF
- if (flag_function_sections && write_symbols != NO_DEBUG)
- warning ("-ffunction-sections may affect debugging on some targets.");
-#endif
-
- /* If dbx symbol table desired, initialize writing it
- and output the predefined types. */
- timevar_push (TV_SYMOUT);
-#ifdef DWARF2_UNWIND_INFO
- if (dwarf2out_do_frame ())
- dwarf2out_frame_init ();
-#endif
-
- (*debug_hooks->init) (main_input_filename);
- timevar_pop (TV_SYMOUT);
-