diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-05-22 12:51:28 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2025-05-22 12:52:03 -0700 |
commit | 13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f (patch) | |
tree | 44ef419d0d5533ac9464061a6801ed0db1c93a49 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 45f6036533bd30966f5e815568b792a7e293a0e8 (diff) | |
download | llvm-13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f.zip llvm-13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f.tar.gz llvm-13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f.tar.bz2 |
Reapply "[clang] Remove intrusive reference count from `DiagnosticOptions` (#139584)"
This reverts commit e2a885537f11f8d9ced1c80c2c90069ab5adeb1d. Build failures were fixed right away and reverting the original commit without the fixes breaks the build again.
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 54a2e3e..af9d18a 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -766,9 +766,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics()); // The AST unit populates its own diagnostics engine rather than ours. - IntrusiveRefCntPtr<DiagnosticsEngine> ASTDiags( - new DiagnosticsEngine(Diags->getDiagnosticIDs(), - &Diags->getDiagnosticOptions())); + IntrusiveRefCntPtr<DiagnosticsEngine> ASTDiags(new DiagnosticsEngine( + Diags->getDiagnosticIDs(), Diags->getDiagnosticOptions())); ASTDiags->setClient(Diags->getClient(), /*OwnsClient*/false); // FIXME: What if the input is a memory buffer? @@ -776,7 +775,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, std::unique_ptr<ASTUnit> AST = ASTUnit::LoadFromASTFile( InputFile, CI.getPCHContainerReader(), ASTUnit::LoadPreprocessorOnly, - ASTDiags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts()); + nullptr, ASTDiags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts()); if (!AST) return false; @@ -842,8 +841,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, StringRef InputFile = Input.getFile(); std::unique_ptr<ASTUnit> AST = ASTUnit::LoadFromASTFile( - InputFile, CI.getPCHContainerReader(), ASTUnit::LoadEverything, Diags, - CI.getFileSystemOpts(), CI.getHeaderSearchOpts(), &CI.getLangOpts()); + InputFile, CI.getPCHContainerReader(), ASTUnit::LoadEverything, nullptr, + Diags, CI.getFileSystemOpts(), CI.getHeaderSearchOpts(), + &CI.getLangOpts()); if (!AST) return false; |