[cfe-commits] [PATCH] Add the resource directory to the search path for Driver::GetFilePath
Peter Collingbourne
peter at pcc.me.uk
Sun Sep 4 10:00:45 PDT 2011
On Sat, Sep 03, 2011 at 11:33:42PM -0400, Rafael Ávila de Espíndola wrote:
> On 11-09-01 5:16 PM, Peter Collingbourne wrote:
> > Hi,
> >
> > This patch adds the resource directory to the search path for
> > Driver::GetFilePath, as well as the search path printed by
> > -print-search-dirs.
> >
> > The main purpose of this change is to cause -print-file-name=include
> > to print the path to the include directory under Clang's resource
> > directory, instead of the system compiler's include directory, whose
> > header files Clang may not be able to parse. Some build scripts will
> > do something like:
> > $(CC) -nostdinc -I`$(CC) -print-file-name=include`
> > to exclude all header paths except the compiler's (I've observed this
> > happening with uclibc).
> >
> > OK to commit?
>
> I think it is OK. I know it is hard to test the driver, but for this
> patch we might be able to check that there is as "/clang/" in the output
> of -print-file-name=include, no?
What if the user has configured clang with a custom resource directory
(i.e. using --with-clang-resource-dir)? I can't see a reliable way
of extracting the resource directory from the driver, and I don't know
if it's worth adding one just for the sake of this test.
Thanks,
--
Peter
More information about the cfe-commits
mailing list