[VFS] Also drop '.' when adding files to an in-memory FS.
Otherwise we won't be able to find them later.
llvm-svn: 249525
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp
index b3805b2..b5bf33f 100644
--- a/clang/lib/Basic/VirtualFileSystem.cpp
+++ b/clang/lib/Basic/VirtualFileSystem.cpp
@@ -495,6 +495,13 @@
auto I = llvm::sys::path::begin(Path), E = llvm::sys::path::end(Path);
while (true) {
StringRef Name = *I;
+ // Skip over ".".
+ // FIXME: Also handle "..".
+ if (Name == ".") {
+ ++I;
+ continue;
+ }
+
detail::InMemoryNode *Node = Dir->getChild(Name);
++I;
if (!Node) {