diff options
author | kadir çetinkaya <kadircet@google.com> | 2024-11-21 12:11:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 12:11:41 +0100 |
commit | bdd10d9d249bd1c2a45e3de56a5accd97e953458 (patch) | |
tree | 5d4c81d8e95dfcecaae9fec5e6a52845fd3023d5 /clang/unittests/Driver | |
parent | 83c7784c35918ce037823f29d29918c5542cdf9c (diff) | |
download | llvm-bdd10d9d249bd1c2a45e3de56a5accd97e953458.zip llvm-bdd10d9d249bd1c2a45e3de56a5accd97e953458.tar.gz llvm-bdd10d9d249bd1c2a45e3de56a5accd97e953458.tar.bz2 |
[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (#115852)
Starting with 41e3919ded78d8870f7c95e9181c7f7e29aa3cc4 DiagnosticsEngine
creation might perform IO. It was implicitly defaulting to
getRealFileSystem. This patch makes it explicit by pushing the decision
making to callers.
It uses ambient VFS if one is available, and keeps using
`getRealFileSystem` if there aren't any VFS.
Diffstat (limited to 'clang/unittests/Driver')
-rw-r--r-- | clang/unittests/Driver/DXCModeTest.cpp | 3 | ||||
-rw-r--r-- | clang/unittests/Driver/ToolChainTest.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/unittests/Driver/DXCModeTest.cpp b/clang/unittests/Driver/DXCModeTest.cpp index 2a079a6..616c07c 100644 --- a/clang/unittests/Driver/DXCModeTest.cpp +++ b/clang/unittests/Driver/DXCModeTest.cpp @@ -219,7 +219,8 @@ TEST(DxcModeTest, DefaultEntry) { const char *Args[] = {"clang", "--driver-mode=dxc", "-Tcs_6_7", "foo.hlsl"}; IntrusiveRefCntPtr<DiagnosticsEngine> Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions()); + CompilerInstance::createDiagnostics(*InMemoryFileSystem, + new DiagnosticOptions()); CreateInvocationOptions CIOpts; CIOpts.Diags = Diags; diff --git a/clang/unittests/Driver/ToolChainTest.cpp b/clang/unittests/Driver/ToolChainTest.cpp index 8542a16..0787e7d 100644 --- a/clang/unittests/Driver/ToolChainTest.cpp +++ b/clang/unittests/Driver/ToolChainTest.cpp @@ -577,7 +577,7 @@ TEST(CompilerInvocation, SplitSwarfSingleCrash) { TEST(ToolChainTest, UEFICallingConventionTest) { clang::CompilerInstance compiler; - compiler.createDiagnostics(); + compiler.createDiagnostics(*llvm::vfs::getRealFileSystem()); std::string TrStr = "x86_64-unknown-uefi"; llvm::Triple Tr(TrStr); |