aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2004-05-05 18:25:52 +0000
committerMike Stump <mrs@gcc.gnu.org>2004-05-05 18:25:52 +0000
commite3c287c9f3141a97a75ea54ca9d99d940765d831 (patch)
treec90d3529878cc7887b1b4e333bac9bb10c41467a /gcc/cppfiles.c
parentf08a3544c21fba472a946b93ad506d6469481311 (diff)
downloadgcc-e3c287c9f3141a97a75ea54ca9d99d940765d831.zip
gcc-e3c287c9f3141a97a75ea54ca9d99d940765d831.tar.gz
gcc-e3c287c9f3141a97a75ea54ca9d99d940765d831.tar.bz2
darwin-c.c (add_framework): Copy the directory name as it can be freed later.
* config/darwin-c.c (add_framework): Copy the directory name as it can be freed later. Also, ensure we always allocate enough room for the cached framework information. (find_subframework_header): Keep track of the directory where the subframework header was found. (framework_construct_pathname): Speed up by not trying to re-add a framework. * cppfiles.c (search_path_exhausted): Arrange for the missing header callback to be able to set the directory where the header was found. (cpp_get_dir): Add. * cpplib.h (missing_header_cb): Add a parameter. (cpp_get_dir): Add. From-SVN: r81534
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index fab78fa..65db6db 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -362,7 +362,7 @@ search_path_exhausted (cpp_reader *pfile, const char *header, _cpp_file *file)
if (func
&& file->dir == NULL)
{
- if ((file->path = func (pfile, header)) != NULL)
+ if ((file->path = func (pfile, header, &file->dir)) != NULL)
{
if (open_file (file))
return true;
@@ -1316,6 +1316,14 @@ cpp_get_path (struct _cpp_file *f)
return f->path;
}
+/* Get the directory associated with the _cpp_file F. */
+
+cpp_dir *
+cpp_get_dir (struct _cpp_file *f)
+{
+ return f->dir;
+}
+
/* Get the cpp_buffer currently associated with the cpp_reader
PFILE. */