diff options
author | James Y Knight <jyknight@google.com> | 2025-07-31 15:07:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-31 15:07:35 -0400 |
commit | c7f343750744fd0c928b1da67e9dd894a2fe52cf (patch) | |
tree | 0e13516db8902e5ab932469e08a7e96a9538e570 /clang/unittests/Basic/SourceManagerTest.cpp | |
parent | 1c60b7da4f7af388b12f4f9b1d46bab0b65c5155 (diff) | |
download | llvm-c7f343750744fd0c928b1da67e9dd894a2fe52cf.zip llvm-c7f343750744fd0c928b1da67e9dd894a2fe52cf.tar.gz llvm-c7f343750744fd0c928b1da67e9dd894a2fe52cf.tar.bz2 |
NFC: Clean up of IntrusiveRefCntPtr construction from raw pointers. (#151545)
Handles clang::DiagnosticsEngine and clang::DiagnosticIDs.
For DiagnosticIDs, this mostly migrates from `new DiagnosticIDs` to
convenience method `DiagnosticIDs::create()`.
Part of cleanup https://github.com/llvm/llvm-project/issues/151026
Diffstat (limited to 'clang/unittests/Basic/SourceManagerTest.cpp')
-rw-r--r-- | clang/unittests/Basic/SourceManagerTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/unittests/Basic/SourceManagerTest.cpp b/clang/unittests/Basic/SourceManagerTest.cpp index cbe047b..04b23dd 100644 --- a/clang/unittests/Basic/SourceManagerTest.cpp +++ b/clang/unittests/Basic/SourceManagerTest.cpp @@ -40,8 +40,8 @@ namespace { class SourceManagerTest : public ::testing::Test { protected: SourceManagerTest() - : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), - Diags(DiagID, DiagOpts, new IgnoringDiagConsumer()), + : FileMgr(FileMgrOpts), + Diags(DiagnosticIDs::create(), DiagOpts, new IgnoringDiagConsumer()), SourceMgr(Diags, FileMgr), TargetOpts(new TargetOptions) { TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts); @@ -49,7 +49,6 @@ protected: FileSystemOptions FileMgrOpts; FileManager FileMgr; - IntrusiveRefCntPtr<DiagnosticIDs> DiagID; DiagnosticOptions DiagOpts; DiagnosticsEngine Diags; SourceManager SourceMgr; |