diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/libcpp/files.c | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/libcpp/files.c')
-rw-r--r-- | gcc-4.9/libcpp/files.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/libcpp/files.c b/gcc-4.9/libcpp/files.c index 7e88778..149f06d 100644 --- a/gcc-4.9/libcpp/files.c +++ b/gcc-4.9/libcpp/files.c @@ -1023,6 +1023,9 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets) int sysp = pfile->line_table->highest_line > 1 && pfile->buffer ? pfile->buffer->sysp : 0; bool print_dep = CPP_OPTION (pfile, deps.style) > (angle_brackets || !!sysp); + if (pfile->state.in__has_include__) + return; + errno = file->err_no; if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT) { @@ -1939,3 +1942,18 @@ check_file_against_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, return bsearch (&d, pchf->entries, pchf->count, sizeof (struct pchf_entry), pchf_compare) != NULL; } + +/* Return true if the file FNAME is found in the appropriate include file path + as indicated by ANGLE_BRACKETS. */ + +bool +_cpp_has_header (cpp_reader *pfile, const char *fname, int angle_brackets, + enum include_type type) +{ + cpp_dir *start_dir = search_path_head (pfile, fname, angle_brackets, type); + _cpp_file *file = _cpp_find_file (pfile, fname, start_dir, + /*fake=*/false, angle_brackets, + /*implicit_preinclude=*/false); + return file->err_no != ENOENT; +} + |