mirror of
https://github.com/intel/llvm.git
synced 2026-01-29 12:53:33 +08:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user