aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-05-22 12:51:28 -0700
committerJan Svoboda <jan_svoboda@apple.com>2025-05-22 12:52:03 -0700
commit13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f (patch)
tree44ef419d0d5533ac9464061a6801ed0db1c93a49 /clang/lib/Basic/SourceManager.cpp
parent45f6036533bd30966f5e815568b792a7e293a0e8 (diff)
downloadllvm-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/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 4028bbf..09e5c65 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -2391,11 +2391,11 @@ SourceManagerForFile::SourceManagerForFile(StringRef FileName,
// in `Environment` so that `FileMgr` can out-live this function scope.
FileMgr =
std::make_unique<FileManager>(FileSystemOptions(), InMemoryFileSystem);
+ 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),
- new DiagnosticOptions);
+ IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), *DiagOpts);
SourceMgr = std::make_unique<SourceManager>(*Diagnostics, *FileMgr);
FileEntryRef FE = llvm::cantFail(FileMgr->getFileRef(FileName));
FileID ID =