summaryrefslogtreecommitdiff
path: root/gcc/cp/lex.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/cp/lex.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/cp/lex.c')
-rw-r--r--gcc/cp/lex.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index f5fdc0f3db4..21e359402f8 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -53,7 +53,6 @@ extern void yyprint PARAMS ((FILE *, int, YYSTYPE));
static int interface_strcmp PARAMS ((const char *));
static int *init_cpp_parse PARAMS ((void));
-static void init_reswords PARAMS ((void));
static void init_cp_pragma PARAMS ((void));
static tree parse_strconst_pragma PARAMS ((const char *, int));
@@ -248,7 +247,7 @@ cxx_post_options ()
void
cxx_init_options ()
{
- parse_in = cpp_create_reader (ident_hash, CLK_GNUCXX);
+ parse_in = cpp_create_reader (CLK_GNUCXX);
/* Default exceptions on. */
flag_exceptions = 1;
@@ -263,15 +262,6 @@ cxx_init_options ()
}
void
-cxx_init ()
-{
- c_common_lang_init ();
-
- if (flag_gnu_xref) GNU_xref_begin (input_filename);
- init_repo (input_filename);
-}
-
-void
cxx_finish ()
{
if (flag_gnu_xref)
@@ -636,7 +626,7 @@ const short rid_to_yy[RID_MAX] =
/* RID_AT_IMPLEMENTATION */ 0
};
-static void
+void
init_reswords ()
{
unsigned int i;
@@ -676,17 +666,18 @@ init_cp_pragma ()
handle_pragma_java_exceptions);
}
+/* Initialize the C++ front end. This function is very sensitive to
+ the exact order that things are done here. It would be nice if the
+ initialization done by this routine were moved to its subroutines,
+ and the ordering dependencies clarified and reduced. */
const char *
-init_parse (filename)
+cxx_init (filename)
const char *filename;
{
decl_printable_name = lang_printable_name;
-
input_filename = "<internal>";
init_reswords ();
- init_pragma ();
- init_cp_pragma ();
init_spew ();
init_tree ();
init_cplus_expand ();
@@ -726,17 +717,28 @@ init_parse (filename)
TREE_TYPE (enum_type_node) = enum_type_node;
ridpointers[(int) RID_ENUM] = enum_type_node;
+ cxx_init_decl_processing ();
+
/* Create the built-in __null node. Note that we can't yet call for
type_for_size here because integer_type_node and so forth are not
set up. Therefore, we don't set the type of these nodes until
- init_decl_processing. */
+ cxx_init_decl_processing. */
null_node = build_int_2 (0, 0);
+ TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
ridpointers[RID_NULL] = null_node;
token_count = init_cpp_parse ();
interface_unknown = 1;
- return init_c_lex (filename);
+ filename = c_common_lang_init (filename);
+
+ init_cp_pragma ();
+
+ if (flag_gnu_xref)
+ GNU_xref_begin (filename);
+ init_repo (filename);
+
+ return filename;
}
void