aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Lex/PPCallbacksTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-22 12:44:20 -0700
committerKazu Hirata <kazu@google.com>2025-05-22 12:44:20 -0700
commite2a885537f11f8d9ced1c80c2c90069ab5adeb1d (patch)
treed838fa124762f02c1b2ce921f667beb29acfee7b /clang/unittests/Lex/PPCallbacksTest.cpp
parente23a6921b47d2cfb4d27289149079e9d77aa0560 (diff)
downloadllvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.zip
llvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.tar.gz
llvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.tar.bz2
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
Diffstat (limited to 'clang/unittests/Lex/PPCallbacksTest.cpp')
-rw-r--r--clang/unittests/Lex/PPCallbacksTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp
index af86c18..c2a84d9 100644
--- a/clang/unittests/Lex/PPCallbacksTest.cpp
+++ b/clang/unittests/Lex/PPCallbacksTest.cpp
@@ -135,8 +135,8 @@ protected:
PPCallbacksTest()
: InMemoryFileSystem(new llvm::vfs::InMemoryFileSystem),
FileMgr(FileSystemOptions(), InMemoryFileSystem),
- DiagID(new DiagnosticIDs()),
- Diags(DiagID, DiagOpts, new IgnoringDiagConsumer()),
+ DiagID(new DiagnosticIDs()), DiagOpts(new DiagnosticOptions()),
+ Diags(DiagID, DiagOpts.get(), new IgnoringDiagConsumer()),
SourceMgr(Diags, FileMgr), TargetOpts(new TargetOptions()) {
TargetOpts->Triple = "x86_64-apple-darwin11.1.0";
Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts);
@@ -145,7 +145,7 @@ protected:
IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem;
FileManager FileMgr;
IntrusiveRefCntPtr<DiagnosticIDs> DiagID;
- DiagnosticOptions DiagOpts;
+ IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
DiagnosticsEngine Diags;
SourceManager SourceMgr;
LangOptions LangOpts;
@@ -437,7 +437,7 @@ TEST_F(PPCallbacksTest, FileNotFoundSkipped) {
HeaderSearch HeaderInfo(HSOpts, SourceMgr, Diags, LangOpts, Target.get());
DiagnosticConsumer *DiagConsumer = new DiagnosticConsumer;
- DiagnosticsEngine FileNotFoundDiags(DiagID, DiagOpts, DiagConsumer);
+ DiagnosticsEngine FileNotFoundDiags(DiagID, DiagOpts.get(), DiagConsumer);
Preprocessor PP(PPOpts, FileNotFoundDiags, LangOpts, SourceMgr, HeaderInfo,
ModLoader, /*IILookup=*/nullptr, /*OwnsHeaderSearch=*/false);
PP.Initialize(*Target);