From e2a885537f11f8d9ced1c80c2c90069ab5adeb1d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 22 May 2025 12:44:20 -0700 Subject: Revert "[clang] Remove intrusive reference count from `DiagnosticOptions` (#139584)" This reverts commit 9e306ad4600c4d3392c194a8be88919ee758425c. Multiple builtbot failures have been reported: https://github.com/llvm/llvm-project/pull/139584 --- clang/lib/Frontend/FrontendAction.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/Frontend/FrontendAction.cpp') diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index af9d18a..54a2e3e 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -766,8 +766,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, IntrusiveRefCntPtr Diags(&CI.getDiagnostics()); // The AST unit populates its own diagnostics engine rather than ours. - IntrusiveRefCntPtr ASTDiags(new DiagnosticsEngine( - Diags->getDiagnosticIDs(), Diags->getDiagnosticOptions())); + IntrusiveRefCntPtr ASTDiags( + new DiagnosticsEngine(Diags->getDiagnosticIDs(), + &Diags->getDiagnosticOptions())); ASTDiags->setClient(Diags->getClient(), /*OwnsClient*/false); // FIXME: What if the input is a memory buffer? @@ -775,7 +776,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, std::unique_ptr AST = ASTUnit::LoadFromASTFile( InputFile, CI.getPCHContainerReader(), ASTUnit::LoadPreprocessorOnly, - nullptr, ASTDiags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts()); + ASTDiags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts()); if (!AST) return false; @@ -841,9 +842,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, StringRef InputFile = Input.getFile(); std::unique_ptr AST = ASTUnit::LoadFromASTFile( - InputFile, CI.getPCHContainerReader(), ASTUnit::LoadEverything, nullptr, - Diags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts(), - &CI.getLangOpts()); + InputFile, CI.getPCHContainerReader(), ASTUnit::LoadEverything, Diags, + CI.getFileSystemOpts(), CI.getHeaderSearchOpts(), &CI.getLangOpts()); if (!AST) return false; -- cgit v1.1