[PATCH] D48626: New option -fwindows-filesystem, affecting #include paths.
Simon Tatham via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 28 01:13:25 PDT 2018
simon_tatham added a comment.
@thakis : no, the backslash support is needed for include directives //in source files//, not just on command lines, because in my experience it's not unusual for Windows-only code bases to be full of things like `#include "Subdir\Header.h"`.
@mstorsjo : in this draft, I traverse the pathname from left to right, and at each level, if the normal case-sensitive lookup succeeds then I don't scan the whole directory looking for other options. As I mentioned above, though, I've since realised I should have done it the other way round, trying the case sensitive lookup on the //whole// pathname in one go first, and not even trying it one level at a time unless that fails.
Although, come to think of it, that's not good enough, because if you have multiple directories on your include //path// then you expect a lot of lookups to fail for reasons that have nothing to do with case. Say, if you compile with `-Ifoo -Ibar`, then every include of a file intended to be found in `bar` will force lots of pointless directory enumeration in `foo` when the initial lookup there doesn't find the file. Hmmm. That suggests to me that perhaps this ought not to be a //global// `-ffudge-my-paths` type option applying to all include directories, and instead perhaps it should be a new kind of `-I` option, so that only lookups relative to that particular include-path directory would get the unusual semantics. What do people think?
Repository:
rC Clang
https://reviews.llvm.org/D48626
More information about the cfe-commits
mailing list