summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp18
-rw-r--r--lldb/source/API/SBData.cpp31
-rw-r--r--lldb/source/API/SBInstruction.cpp5
-rw-r--r--lldb/source/API/SBThread.cpp4
-rw-r--r--lldb/source/API/SBThreadPlan.cpp4
-rw-r--r--lldb/source/API/SBTrace.cpp4
-rw-r--r--lldb/source/API/SBTraceOptions.cpp4
-rw-r--r--lldb/source/API/SBType.cpp6
-rw-r--r--lldb/source/API/SBTypeEnumMember.cpp8
-rw-r--r--lldb/source/API/SBValue.cpp4
10 files changed, 54 insertions, 34 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index e3332a82498..16740868ff7 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -25,6 +25,8 @@
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBTarget.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -555,8 +557,8 @@ lldb::SBCommand SBCommandInterpreter::AddMultiwordCommand(const char *name,
lldb::SBCommand SBCommandInterpreter::AddCommand(
const char *name, lldb::SBCommandPluginInterface *impl, const char *help) {
lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(
- *m_opaque_ptr, name, impl, help));
+ new_command_sp = std::make_shared<CommandPluginInterfaceImplementation>(
+ *m_opaque_ptr, name, impl, help);
if (new_command_sp &&
m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
@@ -569,8 +571,8 @@ SBCommandInterpreter::AddCommand(const char *name,
lldb::SBCommandPluginInterface *impl,
const char *help, const char *syntax) {
lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(
- *m_opaque_ptr, name, impl, help, syntax));
+ new_command_sp = std::make_shared<CommandPluginInterfaceImplementation>(
+ *m_opaque_ptr, name, impl, help, syntax);
if (new_command_sp &&
m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
@@ -631,8 +633,8 @@ lldb::SBCommand SBCommand::AddCommand(const char *name,
if (!m_opaque_sp->IsMultiwordObject())
return lldb::SBCommand();
lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(
- m_opaque_sp->GetCommandInterpreter(), name, impl, help));
+ new_command_sp = std::make_shared<CommandPluginInterfaceImplementation>(
+ m_opaque_sp->GetCommandInterpreter(), name, impl, help);
if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
return lldb::SBCommand(new_command_sp);
return lldb::SBCommand();
@@ -646,8 +648,8 @@ lldb::SBCommand SBCommand::AddCommand(const char *name,
if (!m_opaque_sp->IsMultiwordObject())
return lldb::SBCommand();
lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(
- m_opaque_sp->GetCommandInterpreter(), name, impl, help, syntax));
+ new_command_sp = std::make_shared<CommandPluginInterfaceImplementation>(
+ m_opaque_sp->GetCommandInterpreter(), name, impl, help, syntax);
if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
return lldb::SBCommand(new_command_sp);
return lldb::SBCommand();
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp
index d808ff22f91..54a97614a07 100644
--- a/lldb/source/API/SBData.cpp
+++ b/lldb/source/API/SBData.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <inttypes.h>
-
#include "lldb/API/SBData.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBStream.h"
@@ -18,6 +16,9 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
+#include <cinttypes>
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -381,7 +382,7 @@ void SBData::SetData(lldb::SBError &error, const void *buf, size_t size,
lldb::ByteOrder endian, uint8_t addr_size) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
+ m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
else
{
m_opaque_sp->SetData(buf, size, endian);
@@ -530,8 +531,8 @@ bool SBData::SetDataFromCString(const char *data) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
@@ -560,8 +561,8 @@ bool SBData::SetDataFromUInt64Array(uint64_t *array, size_t array_len) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
@@ -592,8 +593,8 @@ bool SBData::SetDataFromUInt32Array(uint32_t *array, size_t array_len) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
@@ -624,8 +625,8 @@ bool SBData::SetDataFromSInt64Array(int64_t *array, size_t array_len) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
@@ -656,8 +657,8 @@ bool SBData::SetDataFromSInt32Array(int32_t *array, size_t array_len) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
@@ -688,8 +689,8 @@ bool SBData::SetDataFromDoubleArray(double *array, size_t array_len) {
lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
if (!m_opaque_sp.get())
- m_opaque_sp.reset(
- new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ m_opaque_sp = std::make_shared<DataExtractor>(buffer_sp, GetByteOrder(),
+ GetAddressByteSize());
else
m_opaque_sp->SetData(buffer_sp);
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp
index 5b3c0aac2ff..abc390b24b8 100644
--- a/lldb/source/API/SBInstruction.cpp
+++ b/lldb/source/API/SBInstruction.cpp
@@ -10,6 +10,7 @@
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFrame.h"
+
#include "lldb/API/SBInstruction.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBTarget.h"
@@ -25,6 +26,8 @@
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
+#include <memory>
+
//----------------------------------------------------------------------
// We recently fixed a leak in one of the Instruction subclasses where the
// instruction will only hold a weak reference to the disassembler to avoid a
@@ -190,7 +193,7 @@ lldb::InstructionSP SBInstruction::GetOpaque() {
void SBInstruction::SetOpaque(const lldb::DisassemblerSP &disasm_sp,
const lldb::InstructionSP &inst_sp) {
- m_opaque_sp.reset(new InstructionImpl(disasm_sp, inst_sp));
+ m_opaque_sp = std::make_shared<InstructionImpl>(disasm_sp, inst_sp);
}
bool SBInstruction::GetDescription(lldb::SBStream &s) {
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index d19758b0fbd..9d4cb156295 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -44,6 +44,8 @@
#include "lldb/API/SBValue.h"
#include "lldb/lldb-enumerations.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -290,7 +292,7 @@ bool SBThread::GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream) {
SBThreadCollection
SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) {
ThreadCollectionSP threads;
- threads.reset(new ThreadCollection());
+ threads = std::make_shared<ThreadCollection>();
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
diff --git a/lldb/source/API/SBThreadPlan.cpp b/lldb/source/API/SBThreadPlan.cpp
index ba645cba343..cca06df828e 100644
--- a/lldb/source/API/SBThreadPlan.cpp
+++ b/lldb/source/API/SBThreadPlan.cpp
@@ -41,6 +41,8 @@
#include "lldb/API/SBThreadPlan.h"
#include "lldb/API/SBValue.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -58,7 +60,7 @@ SBThreadPlan::SBThreadPlan(const SBThreadPlan &rhs)
SBThreadPlan::SBThreadPlan(lldb::SBThread &sb_thread, const char *class_name) {
Thread *thread = sb_thread.get();
if (thread)
- m_opaque_sp.reset(new ThreadPlanPython(*thread, class_name));
+ m_opaque_sp = std::make_shared<ThreadPlanPython>(*thread, class_name);
}
//----------------------------------------------------------------------
diff --git a/lldb/source/API/SBTrace.cpp b/lldb/source/API/SBTrace.cpp
index b4e7f654b3b..daccdec63f0 100644
--- a/lldb/source/API/SBTrace.cpp
+++ b/lldb/source/API/SBTrace.cpp
@@ -12,6 +12,8 @@
#include "lldb/API/SBTrace.h"
#include "lldb/API/SBTraceOptions.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -92,7 +94,7 @@ void SBTrace::SetTraceUID(lldb::user_id_t uid) {
}
SBTrace::SBTrace() {
- m_trace_impl_sp.reset(new TraceImpl);
+ m_trace_impl_sp = std::make_shared<TraceImpl>();
if (m_trace_impl_sp)
m_trace_impl_sp->uid = LLDB_INVALID_UID;
}
diff --git a/lldb/source/API/SBTraceOptions.cpp b/lldb/source/API/SBTraceOptions.cpp
index a041f740bc0..e48f1dcfc32 100644
--- a/lldb/source/API/SBTraceOptions.cpp
+++ b/lldb/source/API/SBTraceOptions.cpp
@@ -13,11 +13,13 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/TraceOptions.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
SBTraceOptions::SBTraceOptions() {
- m_traceoptions_sp.reset(new TraceOptions());
+ m_traceoptions_sp = std::make_shared<TraceOptions>();
}
lldb::TraceType SBTraceOptions::getType() const {
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 6f7d5c75b25..b67f9bc8404 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -20,6 +20,8 @@
#include "llvm/ADT/APSInt.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -82,7 +84,7 @@ SBType::~SBType() {}
TypeImpl &SBType::ref() {
if (m_opaque_sp.get() == NULL)
- m_opaque_sp.reset(new TypeImpl());
+ m_opaque_sp = std::make_shared<TypeImpl>();
return *m_opaque_sp;
}
@@ -670,7 +672,7 @@ void SBTypeMemberFunction::reset(TypeMemberFunctionImpl *type_member_impl) {
TypeMemberFunctionImpl &SBTypeMemberFunction::ref() {
if (!m_opaque_sp)
- m_opaque_sp.reset(new TypeMemberFunctionImpl());
+ m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
return *m_opaque_sp.get();
}
diff --git a/lldb/source/API/SBTypeEnumMember.cpp b/lldb/source/API/SBTypeEnumMember.cpp
index 44569c31ac1..d8b70a43142 100644
--- a/lldb/source/API/SBTypeEnumMember.cpp
+++ b/lldb/source/API/SBTypeEnumMember.cpp
@@ -14,6 +14,8 @@
#include "lldb/Symbol/Type.h"
#include "lldb/Utility/Stream.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -28,14 +30,14 @@ SBTypeEnumMember::SBTypeEnumMember(const SBTypeEnumMember &rhs)
: m_opaque_sp() {
if (this != &rhs) {
if (rhs.IsValid())
- m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));
+ m_opaque_sp = std::make_shared<TypeEnumMemberImpl>(rhs.ref());
}
}
SBTypeEnumMember &SBTypeEnumMember::operator=(const SBTypeEnumMember &rhs) {
if (this != &rhs) {
if (rhs.IsValid())
- m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));
+ m_opaque_sp = std::make_shared<TypeEnumMemberImpl>(rhs.ref());
}
return *this;
}
@@ -74,7 +76,7 @@ void SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl) {
TypeEnumMemberImpl &SBTypeEnumMember::ref() {
if (m_opaque_sp.get() == NULL)
- m_opaque_sp.reset(new TypeEnumMemberImpl());
+ m_opaque_sp = std::make_shared<TypeEnumMemberImpl>();
return *m_opaque_sp.get();
}
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index b83a4effcd5..439c55e603c 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -46,6 +46,8 @@
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"
+#include <memory>
+
using namespace lldb;
using namespace lldb_private;
@@ -485,7 +487,7 @@ SBType SBValue::GetType() {
lldb::ValueObjectSP value_sp(GetSP(locker));
TypeImplSP type_sp;
if (value_sp) {
- type_sp.reset(new TypeImpl(value_sp->GetTypeImpl()));
+ type_sp = std::make_shared<TypeImpl>(value_sp->GetTypeImpl());
sb_type.SetSP(type_sp);
}
if (log) {
OpenPOWER on IntegriCloud