diff options
author | Kadir Cetinkaya <kadircet@google.com> | 2024-11-21 13:04:30 +0100 |
---|---|---|
committer | Kadir Cetinkaya <kadircet@google.com> | 2024-11-21 14:55:30 +0100 |
commit | df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 (patch) | |
tree | 4f440ad02ebb7990fda10120328a833459b1ab89 /clang/unittests/Serialization/ModuleCacheTest.cpp | |
parent | d800ea7cb12245f65f886e18545ba83355825246 (diff) | |
download | llvm-df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55.zip llvm-df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55.tar.gz llvm-df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55.tar.bz2 |
Reapply "[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (#115852)"
This reverts commit a1153cd6fedd4c906a9840987934ca4712e34cb2 with fixes
to lldb breakages.
Fixes https://github.com/llvm/llvm-project/issues/117145.
Diffstat (limited to 'clang/unittests/Serialization/ModuleCacheTest.cpp')
-rw-r--r-- | clang/unittests/Serialization/ModuleCacheTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/unittests/Serialization/ModuleCacheTest.cpp b/clang/unittests/Serialization/ModuleCacheTest.cpp index a7ca985..6ceee1c 100644 --- a/clang/unittests/Serialization/ModuleCacheTest.cpp +++ b/clang/unittests/Serialization/ModuleCacheTest.cpp @@ -106,11 +106,11 @@ TEST_F(ModuleCacheTest, CachedModuleNewPath) { SmallString<256> MCPArg("-fmodules-cache-path="); MCPArg.append(ModuleCachePath); - IntrusiveRefCntPtr<DiagnosticsEngine> Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions()); CreateInvocationOptions CIOpts; - CIOpts.Diags = Diags; CIOpts.VFS = llvm::vfs::createPhysicalFileSystem(); + IntrusiveRefCntPtr<DiagnosticsEngine> Diags = + CompilerInstance::createDiagnostics(*CIOpts.VFS, new DiagnosticOptions()); + CIOpts.Diags = Diags; // First run should pass with no errors const char *Args[] = {"clang", "-fmodules", "-Fframeworks", @@ -156,11 +156,11 @@ TEST_F(ModuleCacheTest, CachedModuleNewPathAllowErrors) { SmallString<256> MCPArg("-fmodules-cache-path="); MCPArg.append(ModuleCachePath); - IntrusiveRefCntPtr<DiagnosticsEngine> Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions()); CreateInvocationOptions CIOpts; - CIOpts.Diags = Diags; CIOpts.VFS = llvm::vfs::createPhysicalFileSystem(); + IntrusiveRefCntPtr<DiagnosticsEngine> Diags = + CompilerInstance::createDiagnostics(*CIOpts.VFS, new DiagnosticOptions()); + CIOpts.Diags = Diags; // First run should pass with no errors const char *Args[] = {"clang", "-fmodules", "-Fframeworks", |