]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix problem with -MM -MG and missing system header files.
authorJames E Wilson <wilson@specifixinc.com>
Mon, 7 Nov 2005 19:49:04 +0000 (11:49 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 7 Nov 2005 19:49:04 +0000 (11:49 -0800)
PR preprocessor/15220
* cppfiles.c (_cpp_find_file): New parameter angle_brackets.  Fix all
callers.  Pass to open_file_failed.
(open_file_failed): New parameter angle_brackets.  Fix
all callers.  use in print_dep assignment.
* cpphash.h (_cpp_find_file): Add new parm to declaration.
* cppinit.c (cpp_read_main_file): Pass another arg to _cpp_find_file.

From-SVN: r106608

gcc/ChangeLog
gcc/cppfiles.c
gcc/cpphash.h
gcc/cppinit.c

index 17f7036f1e1e19e32adea4c0853a55e63bdcc3c2..658eba4c5393258409290dd50132887e1dbccb16 100644 (file)
@@ -1,3 +1,13 @@
+2005-11-07  James E Wilson  <wilson@specifix.com>
+
+       PR preprocessor/15220
+       * cppfiles.c (_cpp_find_file): New parameter angle_brackets.  Fix all
+       callers.  Pass to open_file_failed.
+       (open_file_failed): New parameter angle_brackets.  Fix
+       all callers.  use in print_dep assignment.
+       * cpphash.h (_cpp_find_file): Add new parm to declaration.
+       * cppinit.c (cpp_read_main_file): Pass another arg to _cpp_find_file.
+
 2005-11-05  Andreas Jaeger  <aj@suse.de>
 
        * fixinc/check.tpl: Adopt for move to subversion.
index 9aea34c4b365a6ec221f5634b6d6b964066c6631..c5587bcdaed7f158d33fba10c2402c1a1257e149 100644 (file)
@@ -164,7 +164,7 @@ static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import);
 static struct cpp_dir *search_path_head (cpp_reader *, const char *fname,
                                 int angle_brackets, enum include_type);
 static const char *dir_name_of_file (_cpp_file *file);
-static void open_file_failed (cpp_reader *pfile, _cpp_file *file);
+static void open_file_failed (cpp_reader *pfile, _cpp_file *file, int);
 static struct file_hash_entry *search_cache (struct file_hash_entry *head,
                                             const cpp_dir *start_dir);
 static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname);
@@ -330,7 +330,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
 
   if (file->err_no != ENOENT)
     {
-      open_file_failed (pfile, file);
+      open_file_failed (pfile, file, 0);
       return true;
     }
 
@@ -360,7 +360,7 @@ _cpp_find_failed (_cpp_file *file)
    to open_file().
 */
 _cpp_file *
-_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake)
+_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake, int angle_brackets)
 {
   struct file_hash_entry *entry, **hash_slot;
   _cpp_file *file;
@@ -391,7 +391,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f
       file->dir = file->dir->next;
       if (file->dir == NULL)
        {
-         open_file_failed (pfile, file);
+         open_file_failed (pfile, file, angle_brackets);
          if (invalid_pch)
            {
              cpp_error (pfile, CPP_DL_ERROR, 
@@ -533,7 +533,7 @@ read_file (cpp_reader *pfile, _cpp_file *file)
 
   if (file->fd == -1 && !open_file (file))
     {
-      open_file_failed (pfile, file);
+      open_file_failed (pfile, file, 0);
       return false;
     }
 
@@ -757,16 +757,17 @@ _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets,
   if (!dir)
     return false;
 
-  return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false),
+  return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false,
+                                                angle_brackets),
                     type == IT_IMPORT);
 }
 
 /* Could not open FILE.  The complication is dependency output.  */
 static void
-open_file_failed (cpp_reader *pfile, _cpp_file *file)
+open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets)
 {
   int sysp = pfile->map ? pfile->map->sysp: 0;
-  bool print_dep = CPP_OPTION (pfile, deps.style) > !!sysp;
+  bool print_dep = CPP_OPTION (pfile, deps.style) > (angle_brackets || !!sysp);
 
   errno = file->err_no;
   if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT)
@@ -948,7 +949,7 @@ _cpp_cleanup_files (cpp_reader *pfile)
 void
 _cpp_fake_include (cpp_reader *pfile, const char *fname)
 {
-  _cpp_find_file (pfile, fname, pfile->buffer->file->dir, true);
+  _cpp_find_file (pfile, fname, pfile->buffer->file->dir, true, 0);
 }
 
 /* Not everyone who wants to set system-header-ness on a buffer can
@@ -1030,7 +1031,7 @@ _cpp_compare_file_date (cpp_reader *pfile, const char *fname,
   if (!dir)
     return -1;
 
-  file = _cpp_find_file (pfile, fname, dir, false);
+  file = _cpp_find_file (pfile, fname, dir, false, angle_brackets);
   if (file->err_no)
     return -1;
 
index e30cdcad63aae55fe93a87d5ad59fef6fb2d3394..8c814b90fb60c37c55878574087d6fcffe21fe00 100644 (file)
@@ -516,7 +516,7 @@ extern void _cpp_destroy_hashtable (cpp_reader *);
 /* In cppfiles.c */
 typedef struct _cpp_file _cpp_file;
 extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname,
-                                 cpp_dir *start_dir, bool fake);
+                                 cpp_dir *start_dir, bool fake, int);
 extern bool _cpp_find_failed (_cpp_file *);
 extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
 extern void _cpp_fake_include (cpp_reader *, const char *);
index b83b6f2528d5d833244ffe67ff9cab6a8cf7f813..8da0857dc7d06e8ec492473fd3eabd1b4f7a2db2 100644 (file)
@@ -466,7 +466,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
     }
 
   pfile->main_file
-    = _cpp_find_file (pfile, fname, &pfile->no_search_path, false);
+    = _cpp_find_file (pfile, fname, &pfile->no_search_path, false, 0);
   if (_cpp_find_failed (pfile->main_file))
     return NULL;