summaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-21 07:29:56 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-21 07:29:56 +0000
commit7e555f5f60ed5adf91885c2c2b4f02687f131210 (patch)
tree63deedc494f43a8e08b2973548c30e790dcbbe8d /gcc/c-lex.c
parent3970e8910fe5cfbdfcdb502b5e2aa2a53a92fda4 (diff)
downloadgcc-7e555f5f60ed5adf91885c2c2b4f02687f131210.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c13
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();