aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-01-13 18:39:26 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-01-13 18:39:26 +0000
commitd6d52dd655506899ea8ddbb5a18c0df16a45f3f9 (patch)
tree842229d5e9effcad193597ab41fcfb2eb4a902bc /gcc/cppfiles.c
parentccd96f0ad82a526127150a8d254fbf70f3c93030 (diff)
downloadgcc-d6d52dd655506899ea8ddbb5a18c0df16a45f3f9.zip
gcc-d6d52dd655506899ea8ddbb5a18c0df16a45f3f9.tar.gz
gcc-d6d52dd655506899ea8ddbb5a18c0df16a45f3f9.tar.bz2
cppfiles.c (_cpp_fake_include): New function.
* cppfiles.c (_cpp_fake_include): New function. * cpphash.h (_cpp_fake_include): New. * cpplib.c (do_line): Call _cpp_fake_include when entering header files in preprocessed input. * cppmain.c (cb_pragma_implementation): Remove handling. (setup_callbacks): Don't register pragmas. From-SVN: r38987
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 91f886b..c480cb4 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -1,6 +1,6 @@
/* Part of CPP library. (include file handling)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -117,6 +117,7 @@ destroy_include_file_node (v)
splay_tree_value v;
{
struct include_file *f = (struct include_file *)v;
+
if (f)
{
purge_cache (f);
@@ -149,6 +150,26 @@ _cpp_never_reread (file)
file->cmacro = NEVER_REREAD;
}
+/* Put a file name in the splay tree, for the sake of cpp_included ().
+ Assume that FNAME has already had its path simplified. */
+void
+_cpp_fake_include (pfile, fname)
+ cpp_reader *pfile;
+ const char *fname;
+{
+ splay_tree_node nd;
+
+ nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
+ if (! nd)
+ {
+ struct include_file *file = xcnew (struct include_file);
+ file->name = xstrdup (fname);
+ splay_tree_insert (pfile->all_include_files,
+ (splay_tree_key) file->name,
+ (splay_tree_value) file);
+ }
+}
+
/* Given a file name, look it up in the cache; if there is no entry,
create one with a non-NULL value (regardless of success in opening
the file). If the file doesn't exist or is inaccessible, this