ClangImporter, IDETool: Conservatively adjust uses of clang::CompilerInstance::createDiagnostics (parameter added)

Per df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 (llvm-project).
This commit is contained in:
Anthony Latsis
2025-04-18 23:33:56 +01:00
parent 36b92178db
commit c8ea55c100
3 changed files with 17 additions and 13 deletions

View File

@@ -276,9 +276,11 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
new clang::DiagnosticOptions()
};
const auto VFS = llvm::vfs::getRealFileSystem();
clang::TextDiagnosticBuffer DiagBuf;
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> ClangDiags =
clang::CompilerInstance::createDiagnostics(DiagOpts.get(), &DiagBuf,
clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf,
/*ShouldOwnClient=*/false);
// Clang expects this to be like an actual command line. So we need to pass in
@@ -356,7 +358,7 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
if (!PPOpts.ImplicitPCHInclude.empty()) {
clang::FileSystemOptions FileSysOpts;
clang::FileManager FileMgr(FileSysOpts);
clang::FileManager FileMgr(FileSysOpts, VFS);
auto PCHContainerOperations =
std::make_shared<clang::PCHContainerOperations>();
std::string HeaderFile = clang::ASTReader::getOriginalSourceFile(