From df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 21 Nov 2024 13:04:30 +0100 Subject: 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. --- clang/unittests/Frontend/OutputStreamTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/unittests/Frontend/OutputStreamTest.cpp') diff --git a/clang/unittests/Frontend/OutputStreamTest.cpp b/clang/unittests/Frontend/OutputStreamTest.cpp index 2618558..fa5d726 100644 --- a/clang/unittests/Frontend/OutputStreamTest.cpp +++ b/clang/unittests/Frontend/OutputStreamTest.cpp @@ -13,6 +13,7 @@ #include "clang/Frontend/TextDiagnosticPrinter.h" #include "clang/FrontendTool/Utils.h" #include "clang/Lex/PreprocessorOptions.h" +#include "llvm/Support/VirtualFileSystem.h" #include "gtest/gtest.h" using namespace llvm; @@ -37,7 +38,7 @@ TEST(FrontendOutputTests, TestOutputStream) { Compiler.setOutputStream(std::move(IRStream)); Compiler.setInvocation(std::move(Invocation)); - Compiler.createDiagnostics(); + Compiler.createDiagnostics(*llvm::vfs::getRealFileSystem()); bool Success = ExecuteCompilerInvocation(&Compiler); EXPECT_TRUE(Success); @@ -62,6 +63,7 @@ TEST(FrontendOutputTests, TestVerboseOutputStreamShared) { Compiler.setInvocation(std::move(Invocation)); IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions(); Compiler.createDiagnostics( + *llvm::vfs::getRealFileSystem(), new TextDiagnosticPrinter(llvm::nulls(), &*DiagOpts), true); Compiler.setVerboseOutputStream(VerboseStream); @@ -91,6 +93,7 @@ TEST(FrontendOutputTests, TestVerboseOutputStreamOwned) { Compiler.setInvocation(std::move(Invocation)); IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions(); Compiler.createDiagnostics( + *llvm::vfs::getRealFileSystem(), new TextDiagnosticPrinter(llvm::nulls(), &*DiagOpts), true); Compiler.setVerboseOutputStream(std::move(VerboseStream)); -- cgit v1.1