aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2020-05-05 23:45:49 -0700
committerJan Korous <jkorous@apple.com>2020-05-07 10:58:43 -0700
commitc0330bc00f528a1f031f507283e3371379714ede (patch)
treeb98f4f20dfc976eafcbcd8cda97777f6099cc856 /llvm/lib/Support/VirtualFileSystem.cpp
parentc2414c20397a752643fea09ac14c9393807adf89 (diff)
downloadllvm-c0330bc00f528a1f031f507283e3371379714ede.zip
llvm-c0330bc00f528a1f031f507283e3371379714ede.tar.gz
llvm-c0330bc00f528a1f031f507283e3371379714ede.tar.bz2
[YAMLVFSWriter] Fix directory handling
For empty directories (except the first one) we've been adding a file with the same name as the directory to the result VFS mapping. Differential Revision: https://reviews.llvm.org/D79551
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 22b4a08..e71b92b 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -2066,7 +2066,8 @@ void JSONWriter::write(ArrayRef<YAMLVFSEntry> Entries,
"Overlay dir must be contained in RPath");
RPath = RPath.slice(OverlayDirLen, RPath.size());
}
- writeEntry(path::filename(Entry.VPath), RPath);
+ if (!Entry.IsDirectory)
+ writeEntry(path::filename(Entry.VPath), RPath);
}
while (!DirStack.empty()) {