This is useful when dealing with headers that are normally used on case-insensitive filesystems, such as the Windows SDK, when cross-compiling from a file-system that is case-sensitive (such as Linux). A prime example would be compiling "#include <windows.h>" (the file is really called Windows.h).
There has been a patch for this before (http://reviews.llvm.org/D2972), but this one is more general, as it works on the virtual filesystem layer, and also supports case-insensitive lookups of parent directories not just the filename.
I was initially worried about performance here. The most common case is trying to lookup a header file in the wrong include path, and instead of a simple stat, this patch will cause a full directory listing for each such attempt.
I tried a version of this patch that used a small Bloom filter for each directory to avoid unnecessary searches for non-existing files, but that broke a lot of modules tests. It seems those tests would end up writing to a module cache directory, but the vfs wasn't aware of those writes so subsequent attempts to open files in that directory would fail because of the filter (yay, cache invalidation). Maybe that could be fixed, and maybe such filtering would be useful for broadly too, but perhaps we could look at that separately.
I measured compile-time of a file in V8 on Linux with and without case-sensitive includes, and also with the filter:
Case sensitive: (default) 8.60s +- 2.90% Case insensitive: 8.74s +- 1.18% Case insensitive w/ filter: 8.46s +- 0.82%
Adding some folks who were on Saleem's patch.