[VFS] Also drop '.' when adding files to an in-memory FS.

Otherwise we won't be able to find them later.

llvm-svn: 249525
This commit is contained in:
Benjamin Kramer
2015-10-07 08:32:50 +00:00
parent 92aa1c02df
commit d5e0b58ef2
2 changed files with 10 additions and 0 deletions

View File

@@ -495,6 +495,13 @@ void InMemoryFileSystem::addFile(const Twine &P, time_t ModificationTime,
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) {