[PATCH] D79531: Make -Wnonportable-include-path ignore drive case on Windows.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 13:02:16 PDT 2020


thakis closed this revision.
thakis marked an inline comment as done.
thakis added a comment.

Landed in d03838343f2199580 <https://reviews.llvm.org/rGd03838343f2199580a1942eb353901add38af909>. Found another bug elsewhere while looking at this, will make a patch for that now.



================
Comment at: clang/lib/Lex/PPDirectives.cpp:2123
+        isLowercase(Name[0]) != isLowercase(RealPathName[0])) {
+      assert(Components.size() >= 3 && "should have drive, backslash, name");
+      FixedDriveRealPath = (Name.substr(0, 1) + RealPathName.substr(1)).str();
----------------
thakis wrote:
> hans wrote:
> > Could it be different for e.g. network drives? I guess maybe they'd still have at least 3 components, but perhaps no drive letter
> Oh, good call, ` /FI\\?\%cd%\test.h` produces a path that's is_absolute() but that returns
> 
> ```
> \\?
> \
> c:
> \
> src
> llvm-project
> test.h
> ```
> 
> as path components (one per line). Looking at how to handle that now. If anyone happens to know, please shout :)
This now strips the common UNC path at the start and restores it at the end if it was there, and there's a test for this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79531/new/

https://reviews.llvm.org/D79531





More information about the llvm-commits mailing list