Skip to content

Commit 5131c23

Browse files
kadircetegorzhdan
authored andcommitted
Reapply "[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (llvm#115852)"
This reverts commit a1153cd with fixes to lldb breakages. Fixes llvm#117145.
1 parent c8c0372 commit 5131c23

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ class CommandObjectTargetModulesDumpClangPCMInfo : public CommandObjectParsed {
22002200
}
22012201

22022202
clang::CompilerInstance compiler;
2203-
compiler.createDiagnostics(*llvm::vfs::getRealFileSystem());
2203+
compiler.createDiagnostics(*FileSystem::Instance().GetVirtualFileSystem());
22042204

22052205
const char *clang_args[] = {"clang", pcm_path};
22062206
compiler.setInvocation(clang::createInvocation(clang_args));

lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,9 @@ ClangModulesDeclVendor::Create(Target &target) {
706706
auto diag_options_up =
707707
clang::CreateAndPopulateDiagOpts(compiler_invocation_argument_cstrs);
708708
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine =
709-
clang::CompilerInstance::createDiagnostics(diag_options_up.release(),
710-
new StoringDiagnosticConsumer);
709+
clang::CompilerInstance::createDiagnostics(
710+
*FileSystem::Instance().GetVirtualFileSystem(),
711+
diag_options_up.release(), new StoringDiagnosticConsumer);
711712

712713
Log *log = GetLog(LLDBLog::Expressions);
713714
LLDB_LOG(log, "ClangModulesDeclVendor's compiler flags {0:$[ ]}",

0 commit comments

Comments
 (0)