aboutsummaryrefslogtreecommitdiff
path: root/gcc/langhooks.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-11-26 23:44:54 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-11-26 23:44:54 +0000
commit4d6baafa31576db4b1f5bc2d79913c9ce96e3a61 (patch)
treec1a2c9c7c2d1ce0412550e13966b5458cdbb8bbe /gcc/langhooks.h
parentd4b4b319a23400caa59bbf0e2db01a8f0e38b34e (diff)
downloadgcc-4d6baafa31576db4b1f5bc2d79913c9ce96e3a61.zip
gcc-4d6baafa31576db4b1f5bc2d79913c9ce96e3a61.tar.gz
gcc-4d6baafa31576db4b1f5bc2d79913c9ce96e3a61.tar.bz2
cppfiles.c (stack_include_file): Don't optimize zero-length files.
* cppfiles.c (stack_include_file): Don't optimize zero-length files. (read_include_file): NUL-terminate read files. * cpplex.c (handle_newline, skip_escaped_newlines, get_effective_char, skip_whitespace, parse_identifier, parse_identifier_slow, parse_number, parse_string, _cpp_lex_direct): Optimize for the fact that buffers are guaranteed NUL-terminated. * cpplib.c (destringize_and_run, cpp_define, handle_assertion): Be sure buffers are NUL terminated. * cppmacro.c (warn_of_redefinition): Kill compile warning. * c-common.c: Include tree-inline.h. (c_language): Move separate definitions here. (c_common_init_options, c_common_post_options): New. (c_common_lang_init): Rename c_common_init. * c-common.h (c_common_lang_init): Similarly. (c_common_init_options, c_common_post_options): New. * c-lang.c (c_post_options): Move body to c_common_post_options. (c_init_options): Use c_common_init_options. (c_init): Update. * langhooks.def: Rearrange. * langhooks.h: Rearrange, and improve comments. * toplev.c (do_compile): New function. (toplev_main): Use it. (lang_independent_f_options, parse_options_and_default_flags, process_options): Remove trailing periods. * Makefile.in: Update. cp: * decl2.c (c_language): Move to c-common.c. * lex.c (cxx_post_options, cxx_init_options): Use c-common.c functions. (cxx_init): Update. objc: * objc-act.c (objc_post_options, objc_init_options): Use c-common.c functions. (ojbc_init): Update. From-SVN: r47362
Diffstat (limited to 'gcc/langhooks.h')
-rw-r--r--gcc/langhooks.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 4ec01e7..befdb0f 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -71,21 +71,8 @@ struct lang_hooks
identifier nodes long enough for the language-specific slots. */
size_t identifier_size;
- /* Called after options parsing, to initialize the front end. The
- main input filename is passed, which may be NULL; the front end
- should return the original filename (e.g. foo.i -> foo.c).
- Return NULL to indicate a serious error of some sort; in that
- case no compilation is performed, and the finish hook is called
- immediately. */
- const char * (*init) PARAMS ((const char *));
-
- /* Called last, as a finalizer. */
- void (*finish) PARAMS ((void));
-
- /* Called immediately after parsing to clear the binding stack. */
- void (*clear_binding_stack) PARAMS ((void));
-
- /* Called to initialize options, before any calls to decode_option. */
+ /* The first callback made to the front end, for simple
+ initialization needed before any calls to decode_option. */
void (*init_options) PARAMS ((void));
/* Function called with an option vector as argument, to decode a
@@ -98,9 +85,26 @@ struct lang_hooks
done for this option. */
int (*decode_option) PARAMS ((int, char **));
- /* Called when all command line options have been parsed. */
+ /* Called when all command line options have been parsed. Should do
+ any required consistency checks, modifications etc. Complex
+ initialization should be left to the "init" callback, since GC
+ and the identifier hashes are set up between now and then. */
void (*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
+ return the original filename (e.g. foo.i -> foo.c). Return NULL
+ to indicate a serious error of some sort; in that case no
+ compilation is performed, and the finish hook is called
+ immediately. */
+ const char * (*init) PARAMS ((const char *));
+
+ /* Called at the end of compilation, as a finalizer. */
+ void (*finish) PARAMS ((void));
+
+ /* Called immediately after parsing to clear the binding stack. */
+ void (*clear_binding_stack) PARAMS ((void));
+
/* Called to obtain the alias set to be used for an expression or type.
Returns -1 if the language does nothing special for it. */
HOST_WIDE_INT (*get_alias_set) PARAMS ((tree));