Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Commit 47bd76d

Browse files
committed
[lldb] Replace deprecated std::unique_ptr::unique() to silence a warning with MS-STL. NFC.
MS-STL warns about this with `warning STL4016: std::shared_ptr::unique() is deprecated in C++17`.
1 parent bd9bec8 commit 47bd76d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lldb/source/API/SBTypeFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ SBTypeFilter::SBTypeFilter(const lldb::TypeFilterImplSP &typefilter_impl_sp)
166166
bool SBTypeFilter::CopyOnWrite_Impl() {
167167
if (!IsValid())
168168
return false;
169-
if (m_opaque_sp.unique())
169+
if (m_opaque_sp.use_count() == 1)
170170
return true;
171171

172172
TypeFilterImplSP new_sp(new TypeFilterImpl(GetOptions()));

lldb/source/API/SBTypeFormat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ bool SBTypeFormat::CopyOnWrite_Impl(Type type) {
157157
if (!IsValid())
158158
return false;
159159

160-
if (m_opaque_sp.unique() &&
160+
if (m_opaque_sp.use_count() == 1 &&
161161
((type == Type::eTypeKeepSame) ||
162162
(type == Type::eTypeFormat &&
163163
m_opaque_sp->GetType() == TypeFormatImpl::Type::eTypeFormat) ||

lldb/source/API/SBTypeSummary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ bool SBTypeSummary::CopyOnWrite_Impl() {
381381
if (!IsValid())
382382
return false;
383383

384-
if (m_opaque_sp.unique())
384+
if (m_opaque_sp.use_count() == 1)
385385
return true;
386386

387387
TypeSummaryImplSP new_sp;

lldb/source/API/SBTypeSynthetic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ SBTypeSynthetic::SBTypeSynthetic(
184184
bool SBTypeSynthetic::CopyOnWrite_Impl() {
185185
if (!IsValid())
186186
return false;
187-
if (m_opaque_sp.unique())
187+
if (m_opaque_sp.use_count() == 1)
188188
return true;
189189

190190
ScriptedSyntheticChildrenSP new_sp(new ScriptedSyntheticChildren(

lldb/source/Core/ModuleList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ bool ModuleList::RemoveIfOrphaned(const Module *module_ptr) {
346346
collection::iterator pos, end = m_modules.end();
347347
for (pos = m_modules.begin(); pos != end; ++pos) {
348348
if (pos->get() == module_ptr) {
349-
if (pos->unique()) {
349+
if (pos->use_count() == 1) {
350350
pos = RemoveImpl(pos);
351351
return true;
352352
} else
@@ -377,7 +377,7 @@ size_t ModuleList::RemoveOrphans(bool mandatory) {
377377
made_progress = false;
378378
collection::iterator pos = m_modules.begin();
379379
while (pos != m_modules.end()) {
380-
if (pos->unique()) {
380+
if (pos->use_count() == 1) {
381381
pos = RemoveImpl(pos);
382382
++remove_count;
383383
// We did make progress.

0 commit comments

Comments
 (0)