toplev.c (main): Call the front-end specific post_options hook if one is given.

* toplev.c (main): Call the front-end specific post_options
        hook if one is given.
        * toplev.h (struct_lang_hooks, lang_hooks): New.
        * c-lang.c (c_post_options, lang_hooks): Implement lang_hooks
        for the C front end.
        * cp/decl2.c (cxx_post_options, lang_hooks): Implement
        lang_hooks for the C++ front end.
        * objc/objc-act.c (objc_post_options, lang_hooks): Implement
        lang_hooks for the ObjC front end.
        * f/com.c (lang_hooks): Hooks for the Fortran front end.
        * java/lang.c (lang_hooks): Hooks for the Java front end.

From-SVN: r38757
This commit is contained in:
Neil Booth 2001-01-07 03:34:28 +00:00 committed by Neil Booth
parent 65289a3a42
commit cd2a3ba227
8 changed files with 64 additions and 1 deletions

View File

@ -1,3 +1,17 @@
2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk>
* toplev.c (main): Call the front-end specific post_options
hook if one is given.
* toplev.h (struct_lang_hooks, lang_hooks): New.
* c-lang.c (c_post_options, lang_hooks): Implement lang_hooks
for the C front end.
* cp/decl2.c (cxx_post_options, lang_hooks): Implement
lang_hooks for the C++ front end.
* objc/objc-act.c (objc_post_options, lang_hooks): Implement
lang_hooks for the ObjC front end.
* f/com.c (lang_hooks): Hooks for the Fortran front end.
* java/lang.c (lang_hooks): Hooks for the Java front end.
2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk>
* c-lex.c (init_c_lex): Request #define / #undef callbacks

View File

@ -38,10 +38,19 @@ Boston, MA 02111-1307, USA. */
static int c_tree_printer PARAMS ((output_buffer *));
static int c_missing_noreturn_ok_p PARAMS ((tree));
static void c_post_options PARAMS ((void));
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {c_post_options};
/* Post-switch processing. */
static void
c_post_options ()
{
}
/* Each of the functions defined here
is an alternative to a function in objc-actions.c. */
int
lang_decode_option (argc, argv)
int argc;

View File

@ -59,6 +59,7 @@ typedef struct priority_info_s {
int destructions_p;
} *priority_info;
static void cxx_post_options PARAMS ((void));
static void mark_vtable_entries PARAMS ((tree));
static void grok_function_init PARAMS ((tree, tree));
static int finish_vtable_vardecl PARAMS ((tree *, void *));
@ -543,6 +544,15 @@ static const char * const unsupported_options[] = {
"strict-prototype",
};
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {cxx_post_options};
/* Post-switch processing. */
static void
cxx_post_options ()
{
}
/* Compare two option strings, pointed two by P1 and P2, for use with
bsearch. */

View File

@ -14676,6 +14676,9 @@ insert_block (block)
= chainon (current_binding_level->blocks, block);
}
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {NULL /* post_options */};
int
lang_decode_option (argc, argv)
int argc;

View File

@ -186,6 +186,9 @@ static int dependency_tracking = 0;
#define DEPEND_TARGET_SET 4
#define DEPEND_FILE_ALREADY_SET 8
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {NULL /* post_options */};
/* Process an option that can accept a `no-' form.
Return 1 if option found, 0 otherwise. */
static int

View File

@ -148,6 +148,7 @@ char *util_firstobj;
static void init_objc PARAMS ((void));
static void finish_objc PARAMS ((void));
static void objc_post_options PARAMS ((void));
/* Code generation. */
@ -626,6 +627,15 @@ static int generating_instance_variables = 0;
static int print_struct_values = 0;
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {objc_post_options};
/* Post-switch processing. */
static void
objc_post_options ()
{
}
/* Some platforms pass small structures through registers versus through
an invisible pointer. Determine at what size structure is the
transition point between the two possibilities. */

View File

@ -4750,6 +4750,10 @@ main (argc, argv)
}
}
/* All command line options have been processed. */
if (lang_hooks.post_options)
(*lang_hooks.post_options) ();
/* Reflect any language-specific diagnostic option setting. */
reshape_diagnostic_buffer ();

View File

@ -133,4 +133,14 @@ extern int sorrycount;
extern const char *progname;
/* Language-specific hooks. */
struct lang_hooks
{
/* If non-NULL, called when all command line options have been processed. */
void (*post_options) PARAMS ((void));
};
/* Each front end provides its own. */
extern struct lang_hooks lang_hooks;
#endif /* __GCC_TOPLEV_H */