aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-01-07 03:34:28 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-01-07 03:34:28 +0000
commitcd2a3ba227ec911a49752265362a07008a50aac6 (patch)
tree4dc1d6254e96cddffb6b0b0b93145fa144532257 /gcc
parent65289a3a42e60ebfe23f858ccfa0e66b13e844ed (diff)
downloadgcc-cd2a3ba227ec911a49752265362a07008a50aac6.zip
gcc-cd2a3ba227ec911a49752265362a07008a50aac6.tar.gz
gcc-cd2a3ba227ec911a49752265362a07008a50aac6.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/c-lang.c11
-rw-r--r--gcc/cp/decl2.c10
-rw-r--r--gcc/f/com.c3
-rw-r--r--gcc/java/lang.c3
-rw-r--r--gcc/objc/objc-act.c10
-rw-r--r--gcc/toplev.c4
-rw-r--r--gcc/toplev.h10
8 files changed, 64 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2e6206c..559b125 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,19 @@
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
for verbose DWARF[2] debugging.
(cb_define, cb_undef): The new callbacks.
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index b96895d..52f6015 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -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;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 1a38f44..4daf590 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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. */
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 40d5116..f6f80e0 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -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;
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 7565eba9..3a9f345 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -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
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 99f2d23..06b0e8c 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -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. */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1608137..0d51302 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -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 ();
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 4e029c0..05fca01 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -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 */