[cfe-dev] [Patch] Fix '-include' Path Search (PR 3395)

Daniel Dunbar daniel at zuster.org
Mon Apr 6 08:45:30 PDT 2009


Hi Jon,
Thanks for the patch!

My feeling is we should fix this bug in clang-cc, not the driver, though. I
would also argue for making an makeAbsolute method on llvm::sys::Path.

This is PR3464 by the way:
http://llvm.org/bugs/show_bug.cgi?id=3464

I think the cleanest way to handle this would be to allow the predefines
buffer to supply the current directory as the place to start the header
search, so the usual search mechanisms handle the resolution. I'm not sure
what this involves, however.

 - Daniel

2009/4/5 Jon Simons <simonsj at ccs.neu.edu>

> Attached is a patch to fix '-include' for clang (PR 3395).
>
> Currently, paths fed to '-include' are treated as relative to the
> compliation unit at hand, instead of to the current working directory
> from which clang was invoked.  The patch coerces relative paths into
> absolute ones, which seem to be handled just fine by the Lexer and
> Preprocessor.
>
> That said, this feels a bit hackish.  I hate munging paths.  It's
> entirely possible someone more familiar could suggest a cleaner way
> :).  Nothing is jumping out at me from my cursory, hobbyist readings.
>
>
> Cool Beans,
> -Jon Simons
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090406/2b40e4bb/attachment.html>


More information about the cfe-dev mailing list