From 13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 May 2025 12:51:28 -0700 Subject: 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. --- clang/unittests/Basic/SourceManagerTest.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clang/unittests/Basic/SourceManagerTest.cpp') diff --git a/clang/unittests/Basic/SourceManagerTest.cpp b/clang/unittests/Basic/SourceManagerTest.cpp index 1f0986f..cbe047b 100644 --- a/clang/unittests/Basic/SourceManagerTest.cpp +++ b/clang/unittests/Basic/SourceManagerTest.cpp @@ -40,11 +40,9 @@ namespace { class SourceManagerTest : public ::testing::Test { protected: SourceManagerTest() - : FileMgr(FileMgrOpts), - DiagID(new DiagnosticIDs()), - Diags(DiagID, new DiagnosticOptions, new IgnoringDiagConsumer()), - SourceMgr(Diags, FileMgr), - TargetOpts(new TargetOptions) { + : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), + Diags(DiagID, DiagOpts, new IgnoringDiagConsumer()), + SourceMgr(Diags, FileMgr), TargetOpts(new TargetOptions) { TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts); } @@ -52,6 +50,7 @@ protected: FileSystemOptions FileMgrOpts; FileManager FileMgr; IntrusiveRefCntPtr DiagID; + DiagnosticOptions DiagOpts; DiagnosticsEngine Diags; SourceManager SourceMgr; LangOptions LangOpts; -- cgit v1.1