llvm-project/clang/lib/Basic
Ben Hamilton 7838101678 [VirtualFileSystem] Support creating directories then adding files inside
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

Reviewers: bkramer, hokein

Reviewed By: bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D40140

llvm-svn: 318445
2017-11-16 19:34:08 +00:00
..
Targets Split x86 "Processor" info into its own def file. [NFC] 2017-11-15 22:25:39 +00:00
Attributes.cpp Add #pragma clang attribute 2017-04-18 14:33:39 +00:00
Builtins.cpp [OpenMP] Implement omp_is_initial_device() as builtin 2017-10-17 14:28:14 +00:00
CMakeLists.txt Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00
CharInfo.cpp
Cuda.cpp [CUDA] Print an error if you try to compile with < sm_30 on CUDA 9. 2017-10-25 21:32:06 +00:00
Diagnostic.cpp Make DiagnosticIDs::getAllDiagnostics static. NFC. 2017-11-14 12:14:49 +00:00
DiagnosticIDs.cpp Make DiagnosticIDs::getAllDiagnostics static. NFC. 2017-11-14 12:14:49 +00:00
DiagnosticOptions.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
FileManager.cpp Use VFS operations in FileManager::makeAbsolutePath. 2017-08-02 07:25:24 +00:00
FileSystemStatCache.cpp [VFS] Replace TimeValue usage with std::chrono 2016-11-09 10:52:22 +00:00
IdentifierTable.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-11-03 22:35:27 +00:00
LangOptions.cpp [Modules] Handle sanitizer feature mismatches when importing modules 2017-06-01 20:01:01 +00:00
MemoryBufferCache.cpp Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
Module.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-11-03 22:35:27 +00:00
ObjCRuntime.cpp Watch and TV OS: wire up basic ABI choices 2015-10-30 16:30:36 +00:00
OpenMPKinds.cpp [OPENMP] Codegen for `#pragma omp target parallel for simd`. 2017-11-09 17:32:15 +00:00
OperatorPrecedence.cpp [OpenCL] Adding reserved operator logical xor for OpenCL 2016-02-03 15:17:14 +00:00
SanitizerBlacklist.cpp Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00
SanitizerSpecialCaseList.cpp Update SanitizerSpecialCaseList to use renamed functions in base class. 2017-11-07 21:16:37 +00:00
Sanitizers.cpp Pull trivial SanitizerSet methods into the header. 2015-07-14 15:34:19 +00:00
SourceLocation.cpp Revert "Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc"" 2017-06-27 09:50:38 +00:00
SourceManager.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-11-03 22:35:27 +00:00
TargetInfo.cpp Convert clang::LangAS to a strongly typed enum 2017-10-15 18:48:14 +00:00
Targets.cpp [Atomic][X8664] set max atomic inline width according to the target 2017-09-22 16:30:00 +00:00
Targets.h [Targets] Move addCygMingDefines into the arch-independent Targets.cpp (NFC) 2017-07-31 18:17:38 +00:00
TokenKinds.cpp
Version.cpp
VersionTuple.cpp
VirtualFileSystem.cpp [VirtualFileSystem] Support creating directories then adding files inside 2017-11-16 19:34:08 +00:00
Warnings.cpp
XRayLists.cpp Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00