This is an archive of the discontinued LLVM Phabricator instance.

[VFS] Fix root directory handling in YAMLVFSWriter
Needs ReviewPublic

Authored by jkorous on May 5 2020, 3:01 PM.

Details

Reviewers
JDevlieghere
Summary

[VFS] Fix root directory handling in YAMLVFSWriter

  • refactor JSONWriter::write
  • handle directories uniformly - don't skip writeEntry only for the first Entry
  • handle entries without a parent directory
  • assert every entry have either a parent dir or is root directory

The testcase previously vioated assert in JSONWriter::containedPart about a previous directory element path being non-empty.

Diff Detail

Event Timeline

jkorous created this revision.May 5 2020, 3:01 PM
jkorous marked 2 inline comments as done.May 5 2020, 3:05 PM
jkorous added inline comments.
llvm/lib/Support/VirtualFileSystem.cpp
2043

Not happy with the name - open to suggestions.

2060

Hmm, maybe I should just move the assert to GetParentOrIfRootDir so it's not duplicated.