[PATCH] D69958: Improve VFS compatibility on Windows

Adrian McCarthy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 11:43:46 PST 2019


amccarth created this revision.
amccarth added reviewers: rnk, vsapsai, arphaman, Bigcheese.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: LLVM.

Keys in a virtual file system can be in Posix or Windows form or even a combination of the two.  Many VFS tests (and a few Clang tests) were XFAILed on Windows because of false negatives when comparing paths.

First, we default CaseSenstive to false on Windows.  This allows drive letters like "D:" to match "d:".  Windows filesystems are, by default, case insensitive, so this makes sense even beyond the drive letter.

Second, we allow slashes to match backslashes when they're used as the root component of a path.

Both of these changes are limited to RedirectingFileSystems, so there's little chance of affecting other path handling.

These changes allow eleven of the VFS tests to pass on Windows as well as three other Clang tests, so they have re-enabled (partially addressing PR43272).


https://reviews.llvm.org/D69958

Files:
  clang/test/Index/index-module-with-vfs.m
  clang/test/Modules/double-quotes.m
  clang/test/Modules/framework-public-includes-private.m
  clang/test/VFS/external-names.c
  clang/test/VFS/framework-import.m
  clang/test/VFS/implicit-include.c
  clang/test/VFS/include-mixed-real-and-virtual.c
  clang/test/VFS/include-real-from-virtual.c
  clang/test/VFS/include-virtual-from-real.c
  clang/test/VFS/include.c
  clang/test/VFS/incomplete-umbrella.m
  clang/test/VFS/module-import.m
  clang/test/VFS/real-path-found-first.m
  clang/test/VFS/relative-path.c
  clang/test/VFS/umbrella-framework-import-skipnonexist.m
  llvm/include/llvm/Support/VirtualFileSystem.h
  llvm/lib/Support/VirtualFileSystem.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69958.228284.patch
Type: text/x-patch
Size: 9650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191107/021a9f70/attachment-0001.bin>


More information about the cfe-commits mailing list