#endif
static void general_init (const char *, bool);
-static void do_compile ();
-static void process_options (void);
static void backend_init (void);
static int lang_dependent_init (const char *);
static void init_asm_output (const char *);
static void crash_signal (int) ATTRIBUTE_NORETURN;
static void compile_file (void);
-/* True if we don't need a backend (e.g. preprocessing only). */
-static bool no_backend;
-
/* Decoded options, and number of such options. */
struct cl_decoded_option *save_decoded_options;
unsigned int save_decoded_options_count;
/* Process the options that have been parsed. */
static void
-process_options (void)
+process_options (bool no_backend)
{
const char *language_string = lang_hooks.name;
/* Just in case lang_hooks.post_options ends up calling a debug_hook.
maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
- /* Allow the front end to perform consistency checks and do further
- initialization based on the command line options. This hook also
- sets the original filename if appropriate (e.g. foo.i -> foo.c)
- so we can correctly initialize debug output. */
- no_backend = lang_hooks.post_options (&main_input_filename);
-
/* Some machines may reject certain combinations of options. */
location_t saved_location = input_location;
input_location = UNKNOWN_LOCATION;
/* Initialize the compiler, and compile the input file. */
static void
-do_compile ()
+do_compile (bool no_backend)
{
- process_options ();
-
/* Don't do any more if an error has already occurred. */
if (!seen_error ())
{
void
toplev::run_self_tests ()
{
- if (no_backend)
- {
- error_at (UNKNOWN_LOCATION, "self-tests incompatible with %<-E%>");
- return;
- }
#if CHECKING_P
/* Reset some state. */
input_location = UNKNOWN_LOCATION;
/* Exit early if we can (e.g. -help). */
if (!exit_after_options)
{
+ /* Allow the front end to perform consistency checks and do further
+ initialization based on the command line options. This hook also
+ sets the original filename if appropriate (e.g. foo.i -> foo.c)
+ so we can correctly initialize debug output. */
+ bool no_backend = lang_hooks.post_options (&main_input_filename);
+
+ process_options (no_backend);
+
if (m_use_TV_TOTAL)
start_timevars ();
- do_compile ();
+ do_compile (no_backend);
+
+ if (flag_self_test)
+ {
+ if (no_backend)
+ error_at (UNKNOWN_LOCATION, "self-tests incompatible with %<-E%>");
+ else
+ run_self_tests ();
+ }
}
if (warningcount || errorcount || werrorcount)
print_ignored_options ();
- if (flag_self_test)
- run_self_tests ();
-
/* Invoke registered plugin callbacks if any. Some plugins could
emit some diagnostics here. */
invoke_plugin_callbacks (PLUGIN_FINISH, NULL);