From bdd10d9d249bd1c2a45e3de56a5accd97e953458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kadir=20=C3=A7etinkaya?= Date: Thu, 21 Nov 2024 12:11:41 +0100 Subject: [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. --- clang/unittests/Driver/ToolChainTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/unittests/Driver/ToolChainTest.cpp') 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); -- cgit v1.1