From: James E Wilson Date: Mon, 7 Nov 2005 19:49:04 +0000 (-0800) Subject: Fix problem with -MM -MG and missing system header files. X-Git-Tag: releases/gcc-3.4.5~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06ee884d750c1c09bbfef1a3115f25e1517722ad;p=thirdparty%2Fgcc.git Fix problem with -MM -MG and missing system header files. 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17f7036f1e1e..658eba4c5393 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2005-11-07 James E Wilson + + 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 * fixinc/check.tpl: Adopt for move to subversion. diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 9aea34c4b365..c5587bcdaed7 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -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; diff --git a/gcc/cpphash.h b/gcc/cpphash.h index e30cdcad63aa..8c814b90fb60 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -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 *); diff --git a/gcc/cppinit.c b/gcc/cppinit.c index b83b6f2528d5..8da0857dc7d0 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -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;