summaryrefslogtreecommitdiff
path: root/gcc/ada/misc.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-15 10:01:10 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-15 10:01:10 +0000
commit9ceb1c2907775b4c7ec85297d865873057c95a76 (patch)
treecac90266aeb52525edc15fddc73e9428ce8a8556 /gcc/ada/misc.c
parent3e6f9f2db90fbb87b3a62e08ec2682c7591588c2 (diff)
downloadgcc-9ceb1c2907775b4c7ec85297d865873057c95a76.tar.gz
* c-common.c: Include c-lex.h.
(c_common_lang_init): Change prototype. Call init_c_lex and init_pragma from here. * c-common.h (c_common_lang_init): Change prototype. * c-decl.c (init_decl_processing): Rename. Call c_parse_init. * c-lang.c (c_init): Change prototype. Update. (c_init_options): Update. * c-lex.c (cpp_filename): Remove. (init_c_lex): Update. Read the main file, and get the original file name. (yyparse): Finish the command line options. * c-parse.in (c_parse_init): Call init_reswords here. (init_parse): Remove. * c-tree.h (c_init_decl_processing): New. * cpphash.c (_cpp_init_hashtable): After initializing the hash table, populate it. * cppinit.c (read_original_filename, cpp_finish_options): New. (cpp_create_reader): New prototype. Defer hash table initialization. (cpp_start_read): Rename cpp_read_main_file. Initialize the hash table. Get the original filename. * cpplib.h (cpp_create_reader): Update. (cpp_start_read): Remove. (cpp_read_main_file, cpp_finish_options): New. * cppmain.c (main, do_preprocessing): Update. * langhooks.h (struct langhooks): Update init prototype. * toplev.c (general_init, parse_options_and_default_flags, process_options, lang_indpendent_init, lang_dependent_init, init_asm_output): New; perform the bulk of initialization. (compile_file): Move most of initialization to above functions. (debug_hooks): Initialize statically. (set_Wunused): Relocate. (toplev_main): Move most of initialization to other init functions. Have a clear logic flow. * tree.h (init_parse, init_decl_processing): Remove. ada: * misc.c (gnat_init): Change prototype. Include the functionality of the old init_parse and init_decl_processing. (gnat_init_decl_processing): New prototype. (init_parse): Remove. * utils.c (init_decl_processing): Rename gnat_init_decl_processing. cp: * cp-tree.h (init_reswords, cxx_init_decl_processing): New. (cxx_init): Update prototype. * decl.c (init_decl_processing): Rename. Move null node init to its creation time. * lex.c (cxx_init_options): Update. (cxx_init): Combine with old init_parse; also call cxx_init_decl_processing. f: * com.c (ffecom_init_decl_processing): Renamed from init_decl_processing. (init_parse): Move contents to ffe_init. (ffe_init): Update prototype. java: * decl.c (init_decl_processing): Rename java_init_decl_processing. * java-tree.h: New prototype. * lang.c (java_init): Update prototype. Combine with old init_parse. objc: * objc-act.c (objc_init): Update prototype, combine with old init_parse. (objc_init_options): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47046 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/misc.c')
-rw-r--r--gcc/ada/misc.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 3a334946614..0ea1339be61 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
* *
* Copyright (C) 1992-2001 Free Software Foundation, Inc. *
* *
@@ -109,12 +109,13 @@ const char *gnat_tree_code_name[] = {
};
#undef DEFTREECODE
-static void gnat_init PARAMS ((void));
+static const char *gnat_init PARAMS ((const char *));
static void gnat_init_options PARAMS ((void));
static int gnat_decode_option PARAMS ((int, char **));
static HOST_WIDE_INT gnat_get_alias_set PARAMS ((tree));
static void gnat_print_decl PARAMS ((FILE *, tree, int));
static void gnat_print_type PARAMS ((FILE *, tree, int));
+extern void gnat_init_decl_processing PARAMS ((void));
/* Structure giving our language-specific hooks. */
@@ -342,11 +343,38 @@ internal_error_function (msgid, ap)
/* Perform all the initialization steps that are language-specific. */
-void
-gnat_init ()
+static const char *
+gnat_init (filename)
+ const char *filename;
{
+/* Performs whatever initialization steps needed by the language-dependent
+ lexical analyzer.
+
+ Define the additional tree codes here. This isn't the best place to put
+ it, but it's where g++ does it. */
+
+ lang_expand_expr = gnat_expand_expr;
+ lang_expand_constant = gnat_expand_constant;
+
+ memcpy ((char *) (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE),
+ (char *) gnat_tree_code_type,
+ ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+ * sizeof (char *)));
+
+ memcpy ((char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
+ (char *) gnat_tree_code_length,
+ ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+ * sizeof (int)));
+
+ memcpy ((char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
+ (char *) gnat_tree_code_name,
+ ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+ * sizeof (char *)));
+
+ gnat_init_decl_processing ();
+
/* Add the input filename as the last argument. */
- gnat_argv [gnat_argc] = (char *) input_filename;
+ gnat_argv [gnat_argc] = (char *) filename;
gnat_argc++;
gnat_argv [gnat_argc] = 0;
@@ -365,6 +393,8 @@ gnat_init ()
#if defined(MIPS_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO)
dwarf2out_set_demangle_name_func (convert_ada_name_to_qualified_name);
#endif
+
+ return filename;
}
/* If DECL has a cleanup, build and return that cleanup here.
@@ -849,37 +879,6 @@ insert_code_for (gnat_node)
}
}
-/* Performs whatever initialization steps needed by the language-dependent
- lexical analyzer.
-
- Define the additional tree codes here. This isn't the best place to put
- it, but it's where g++ does it. */
-
-const char *
-init_parse (filename)
- const char *filename;
-{
- lang_expand_expr = gnat_expand_expr;
- lang_expand_constant = gnat_expand_constant;
-
- memcpy ((char *) (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_type,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
-
- memcpy ((char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_length,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (int)));
-
- memcpy ((char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_name,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
-
- return filename;
-}
-
void
finish_parse ()
{