From c0330bc00f528a1f031f507283e3371379714ede Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 5 May 2020 23:45:49 -0700 Subject: [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 --- llvm/lib/Support/VirtualFileSystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 22b4a08db9f7..e71b92b0718e 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -2066,7 +2066,8 @@ void JSONWriter::write(ArrayRef 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()) { -- cgit v1.2.3