[PATCH] D19842: In openFileForRead, attempt to fetch the actual name of the file on disk -- including case -- so that clang can later warn about non-portable #include and #import directives.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 11:32:32 PDT 2016


Could you please measure the slowdown?  It'd help evaluate this decision.

On Wednesday, May 11, 2016, Eric Niebler <eniebler at boost.org> wrote:

> eric_niebler added a comment.
>
> > Can you split the functionality that gets the RealPath into a new
> function (something like llvm::sys::fs::canonical() or
> llvm::sys::fs::realpath()) and make openFileForRead calls it?
>
> >  [...]
>
> >  This is going to be useful for a bunch of other client in clang that
> are now obtaining realpath in a adhoc/slow ways.
>
>
> I hesitate to do that. The code in `openFileForRead` is less reusable than
> it appears. It prefers speed over correctness since opening files for
> reading is a hot path. If we make it a separate dedicated API, clients will
> have a reasonable expectation that it returns the correct results. Making
> it correct necessarily means making it slow, which means it would no longer
> be useable in `openFileForRead`.
>
>
> http://reviews.llvm.org/D19842
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160511/1bd80477/attachment.html>


More information about the llvm-commits mailing list