This is an archive of the discontinued LLVM Phabricator instance.

[VirtualFileSystem] Support creating directories then adding files inside
ClosedPublic

Authored by benhamilton on Nov 16 2017, 10:42 AM.

Details

Summary

In https://reviews.llvm.org/D39572 , I added support for specifying
Type when invoking InMemoryFileSystem::addFile().

However, I didn't account for the fact that when Type is
directory_file, we need to construct an InMemoryDirectory, not an
InMemoryFile, or else clients cannot create files inside that
directory.

This diff fixes the bug and adds a test.

Test Plan: New test added. Ran test with:

% make -j12 check-clang-tools

Diff Detail

Repository
rL LLVM

Event Timeline

benhamilton created this revision.Nov 16 2017, 10:42 AM
  • Update docs for addFile and addFileNoOwn
bkramer accepted this revision.Nov 16 2017, 11:07 AM

lg

lib/Basic/VirtualFileSystem.cpp
535 ↗(On Diff #123214)

Style: variables start with a capital letter.

This revision is now accepted and ready to land.Nov 16 2017, 11:07 AM
  • Fix style.
This revision was automatically updated to reflect the committed changes.