diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-02-21 07:29:56 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-02-21 07:29:56 +0000 |
commit | 373e217703ba0c771832fb8f634c98022f5be353 (patch) | |
tree | 63deedc494f43a8e08b2973548c30e790dcbbe8d /gcc/c-lex.c | |
parent | 75beacf8857ecce10fcfdaf4e00dbe21cb56e224 (diff) | |
download | gcc-373e217703ba0c771832fb8f634c98022f5be353.tar.gz |
cppfiles.c: Update comments.
* cppfiles.c: Update comments.
(_cpp_read_file): Don't check for NULL filenames any more.
* cppinit.c (cpp_start_read): Don't do canonicalization of
in_fname and out_fname. Use the passed file name exclusively.
(_cpp_handle_options): Don't treat "-" as a command line option,
but as a normal filename.
(_cpp_post_options): Canonicalize in_fname and out_fname.
* cppmain.c (printer_init): Don't check out_fname for NULL.
* c-lex.c (orig_filename): Rename cpp_filename for clarity.
(init_c_lex): Update, and use "" to represent stdin to CPP.
(yyparse): Update.
From-SVN: r39938
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index c147648d1bb..9078361ad15 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -53,8 +53,8 @@ Boston, MA 02111-1307, USA. */ #define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME)) #endif -/* The original file name, before changing "-" to "stdin". */ -static const char *orig_filename; +/* The input filename as understood by CPP, where "" represents stdin. */ +static const char *cpp_filename; /* We may keep statistics about how long which files took to compile. */ static int header_time, body_time; @@ -102,8 +102,6 @@ init_c_lex (filename) struct cpp_callbacks *cb; struct c_fileinfo *toplevel; - orig_filename = filename; - /* Set up filename timing. Must happen before cpp_start_read. */ file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp, 0, @@ -136,8 +134,11 @@ init_c_lex (filename) cb->undef = cb_undef; } + if (filename == 0 || !strcmp (filename, "-")) - filename = "stdin"; + filename = "stdin", cpp_filename = ""; + else + cpp_filename = filename; /* Start it at 0. */ lineno = 0; @@ -151,7 +152,7 @@ init_c_lex (filename) int yyparse() { - if (! cpp_start_read (parse_in, orig_filename)) + if (! cpp_start_read (parse_in, cpp_filename)) return 1; /* cpplib has emitted an error. */ return yyparse_1(); |