don't init backends if preprocessing only.
* langhooks-def.h (LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.h (struct lang_hooks): Update post_options to
return a boolean.
* toplev.c (parse_options_and_default_flags, do_compile,
lang_independent_init): Update prototypes. Allow the
front end to specify that there is no need to initialize
the back end.
(general_init): Move call to hex_init here...
(toplev_main): ...from here. Pass flag for back end init
suppression.
java:
* lang.c (java_post_options): Update prototype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55306
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-07-07 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-common.c (c_common_post_options): Update prototype;
+ don't init backends if preprocessing only.
+ * langhooks-def.h (LANG_HOOKS_POST_OPTIONS): Update.
+ * langhooks.h (struct lang_hooks): Update post_options to
+ return a boolean.
+ * toplev.c (parse_options_and_default_flags, do_compile,
+ lang_independent_init): Update prototypes. Allow the
+ front end to specify that there is no need to initialize
+ the back end.
+ (general_init): Move call to hex_init here...
+ (toplev_main): ...from here. Pass flag for back end init
+ suppression.
+
Sun Jul 7 20:38:38 2002 J"orn Rennecke <joern.rennecke@superh.com>
* sh.h (PRINT_OPERAND_PUNCT_VALID_P): Allow '\''.
}
/* Post-switch processing. */
-void
+bool
c_common_post_options ()
{
cpp_post_options (parse_in);
/* If an error has occurred in cpplib, note it so we fail
immediately. */
errorcount += cpp_errors (parse_in);
+
+ return flag_preprocess_only;
}
/* Hook that registers front end and target-specific built-ins. */
extern tree build_va_arg PARAMS ((tree, tree));
extern void c_common_init_options PARAMS ((enum c_language_kind));
-extern void c_common_post_options PARAMS ((void));
+extern bool c_common_post_options PARAMS ((void));
extern const char *c_common_init PARAMS ((const char *));
extern void c_common_finish PARAMS ((void));
extern void c_common_parse_file PARAMS ((int));
+2002-07-07 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.c (java_post_options): Update prototype.
+
2002-07-05 Roger Sayle <roger@eyesopen.com>
* java/builtins.c (initialize_builtins): Ignore the additional
static const char *java_init PARAMS ((const char *));
static void java_finish PARAMS ((void));
static void java_init_options PARAMS ((void));
-static void java_post_options PARAMS ((void));
+static bool java_post_options PARAMS ((void));
static int java_decode_option PARAMS ((int, char **));
static void put_decl_string PARAMS ((const char *, int));
}
/* Post-switch processing. */
-static void
+static bool
java_post_options ()
{
/* Turn off RTL inliner unless -finline-functions was really specified. */
flag_no_inline = 1;
flag_inline_functions = 0;
}
+
+ /* Initialize the compiler back end. */
+ return false;
}
#include "gt-java-lang.h"
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
#define LANG_HOOKS_INIT_OPTIONS lhd_do_nothing
#define LANG_HOOKS_DECODE_OPTION lhd_decode_option
-#define LANG_HOOKS_POST_OPTIONS hook_void_void
+#define LANG_HOOKS_POST_OPTIONS hook_void_bool_false
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
initialization should be left to the "init" callback, since GC
and the identifier hashes are set up between now and then.
+ Should return zero unless the compiler back-end does not need to
+ be initialized, such as with the -E option.
+
If errorcount is non-zero after this call the compiler exits
immediately and the finish hook is not called. */
- void (*post_options) PARAMS ((void));
+ bool (*post_options) PARAMS ((void));
/* Called after post_options, to initialize the front end. The main
input filename is passed, which may be NULL; the front end should
extern tree last_assemble_variable_decl;
static void general_init PARAMS ((char *));
-static void parse_options_and_default_flags PARAMS ((int, char **));
-static void do_compile PARAMS ((void));
+static bool parse_options_and_default_flags PARAMS ((int, char **));
+static void do_compile PARAMS ((int));
static void process_options PARAMS ((void));
-static void lang_independent_init PARAMS ((void));
+static void lang_independent_init PARAMS ((int));
static int lang_dependent_init PARAMS ((const char *));
static void init_asm_output PARAMS ((const char *));
static void finalize PARAMS ((void));
xmalloc_set_program_name (progname);
+ hex_init ();
+
gcc_init_libintl ();
/* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
/* Parse command line options and set default flag values, called
after language-independent option-independent initialization. Do
minimal options processing. Outputting diagnostics is OK, but GC
- and identifier hashtables etc. are not initialized yet. */
-static void
+ and identifier hashtables etc. are not initialized yet.
+
+ Return non-zero to suppress compiler back end initialization. */
+static bool
parse_options_and_default_flags (argc, argv)
int argc;
char **argv;
/* All command line options have been parsed; allow the front end to
perform consistency checks, etc. */
- (*lang_hooks.post_options) ();
+ return (*lang_hooks.post_options) ();
}
\f
/* Process the options that have been parsed. */
/* Language-independent initialization, before language-dependent
initialization. */
static void
-lang_independent_init ()
+lang_independent_init (no_backend)
+ int no_backend;
{
/* Initialize the garbage-collector, and string pools. */
init_ggc ();
init_stringpool ();
init_obstacks ();
+ if (no_backend)
+ return;
+
/* init_emit_once uses reg_raw_mode and therefore must be called
after init_regs which initialized reg_raw_mode. */
init_regs ();
\f
/* Initialize the compiler, and compile the input file. */
static void
-do_compile ()
+do_compile (no_backend)
+ int no_backend;
{
/* The bulk of command line switch processing. */
process_options ();
timevar_start (TV_TOTAL);
/* Language-independent initialization. Also sets up GC, identifier
- hashes etc. */
- lang_independent_init ();
+ hashes etc., and the back-end if requested. */
+ lang_independent_init (no_backend);
/* Language-dependent initialization. Returns true on success. */
if (lang_dependent_init (filename))
int argc;
char **argv;
{
- hex_init ();
+ bool no_backend;
/* Initialization of GCC's environment, and diagnostics. */
general_init (argv[0]);
/* Parse the options and do minimal processing; basically just
enough to default flags appropriately. */
- parse_options_and_default_flags (argc, argv);
+ no_backend = parse_options_and_default_flags (argc, argv);
/* Exit early if we can (e.g. -help). */
if (!errorcount && !exit_after_options)
- do_compile ();
+ do_compile (no_backend);
if (errorcount || sorrycount)
return (FATAL_EXIT_CODE);