[lldb/API] Use std::make_unique<> (NFC)

I was holding off on this change until we moved to C++14 as to not have
to convert llvm::make_unique to std::make_unique. That happened a while
ago so here's the first patch for the API which had a bunch of raw
`new`s.
This commit is contained in:
Jonas Devlieghere
2020-06-24 16:25:05 -07:00
parent 6330653547
commit 1c0bbe4341
16 changed files with 40 additions and 39 deletions

View File

@@ -66,7 +66,7 @@ void SBStringList::AppendString(const char *str) {
if (IsValid())
m_opaque_up->AppendString(str);
else
m_opaque_up.reset(new lldb_private::StringList(str));
m_opaque_up = std::make_unique<lldb_private::StringList>(str);
}
}
@@ -78,7 +78,7 @@ void SBStringList::AppendList(const char **strv, int strc) {
if (IsValid())
m_opaque_up->AppendList(strv, strc);
else
m_opaque_up.reset(new lldb_private::StringList(strv, strc));
m_opaque_up = std::make_unique<lldb_private::StringList>(strv, strc);
}
}
@@ -88,14 +88,14 @@ void SBStringList::AppendList(const SBStringList &strings) {
if (strings.IsValid()) {
if (!IsValid())
m_opaque_up.reset(new lldb_private::StringList());
m_opaque_up = std::make_unique<lldb_private::StringList>();
m_opaque_up->AppendList(*(strings.m_opaque_up));
}
}
void SBStringList::AppendList(const StringList &strings) {
if (!IsValid())
m_opaque_up.reset(new lldb_private::StringList());
m_opaque_up = std::make_unique<lldb_private::StringList>();
m_opaque_up->AppendList(strings);
}