Adjust calls to clang::DiagnosticsEngine ctor (now takes ref vs. ptr)

See https://github.com/llvm/llvm-project/pull/139584
This commit is contained in:
Anthony Latsis
2025-06-11 15:50:42 +01:00
parent 9322c9f992
commit 0981b71090
7 changed files with 29 additions and 35 deletions

View File

@@ -267,15 +267,12 @@ bool ide::initCompilerInvocation(
bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
CompilerInvocation &Invok,
std::string &Error) {
llvm::IntrusiveRefCntPtr<clang::DiagnosticOptions> DiagOpts{
new clang::DiagnosticOptions()
};
const auto VFS = llvm::vfs::getRealFileSystem();
clang::TextDiagnosticBuffer DiagBuf;
clang::DiagnosticOptions DiagOpts;
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> ClangDiags =
clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf,
clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts, &DiagBuf,
/*ShouldOwnClient=*/false);
// Clang expects this to be like an actual command line. So we need to pass in