aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2025-07-31 15:07:35 -0400
committerGitHub <noreply@github.com>2025-07-31 15:07:35 -0400
commitc7f343750744fd0c928b1da67e9dd894a2fe52cf (patch)
tree0e13516db8902e5ab932469e08a7e96a9538e570 /clang/lib/Basic/SourceManager.cpp
parent1c60b7da4f7af388b12f4f9b1d46bab0b65c5155 (diff)
downloadllvm-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/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 5b8444a..343c26e 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -2379,8 +2379,8 @@ SourceManagerForFile::SourceManagerForFile(StringRef FileName,
DiagOpts = std::make_unique<DiagnosticOptions>();
// This is passed to `SM` as reference, so the pointer has to be referenced
// by `Environment` due to the same reason above.
- Diagnostics = std::make_unique<DiagnosticsEngine>(
- IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), *DiagOpts);
+ Diagnostics =
+ std::make_unique<DiagnosticsEngine>(DiagnosticIDs::create(), *DiagOpts);
SourceMgr = std::make_unique<SourceManager>(*Diagnostics, *FileMgr);
FileEntryRef FE = llvm::cantFail(FileMgr->getFileRef(FileName));
FileID ID =