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
Style: variables start with a capital letter.