Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/include/lldb/Target/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ void PruneThreadPlans();

void ResetExtendedCrashInfoDict() {
// StructuredData::Dictionary is add only, so we have to make a new one:
m_crash_info_dict_sp.reset(new StructuredData::Dictionary());
m_crash_info_dict_sp = std::make_shared<StructuredData::Dictionary>();
}

size_t AddImageToken(lldb::addr_t image_ptr);
Expand Down
59 changes: 29 additions & 30 deletions lldb/source/API/SBType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,57 +184,57 @@ SBType SBType::GetPointerType() {
if (!IsValid())
return SBType();

return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointerType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetPointerType()));
}

SBType SBType::GetPointeeType() {
LLDB_INSTRUMENT_VA(this);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointeeType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetPointeeType()));
}

SBType SBType::GetReferenceType() {
LLDB_INSTRUMENT_VA(this);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetReferenceType()));
}

SBType SBType::GetTypedefedType() {
LLDB_INSTRUMENT_VA(this);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetTypedefedType()));
}

SBType SBType::GetDereferencedType() {
LLDB_INSTRUMENT_VA(this);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetDereferencedType()));
}

SBType SBType::GetArrayElementType() {
LLDB_INSTRUMENT_VA(this);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(
m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr))));
return SBType(std::make_shared<TypeImpl>(
m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr)));
}

SBType SBType::GetArrayType(uint64_t size) {
LLDB_INSTRUMENT_VA(this, size);

if (!IsValid())
return SBType();
return SBType(TypeImplSP(
new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size))));
return SBType(std::make_shared<TypeImpl>(
m_opaque_sp->GetCompilerType(true).GetArrayType(size)));
}

SBType SBType::GetVectorElementType() {
Expand All @@ -245,7 +245,7 @@ SBType SBType::GetVectorElementType() {
CompilerType vector_element_type;
if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type,
nullptr))
type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type)));
type_sb.SetSP(std::make_shared<TypeImpl>(vector_element_type));
}
return type_sb;
}
Expand Down Expand Up @@ -421,14 +421,14 @@ lldb::SBType SBType::GetUnqualifiedType() {

if (!IsValid())
return SBType();
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetUnqualifiedType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetUnqualifiedType()));
}

lldb::SBType SBType::GetCanonicalType() {
LLDB_INSTRUMENT_VA(this);

if (IsValid())
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCanonicalType())));
return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetCanonicalType()));
return SBType();
}

Expand Down Expand Up @@ -508,7 +508,7 @@ SBTypeMember SBType::GetDirectBaseClassAtIndex(uint32_t idx) {
idx, &bit_offset);
if (base_class_type.IsValid())
sb_type_member.reset(new TypeMemberImpl(
TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
std::make_shared<TypeImpl>(base_class_type), bit_offset));
}
return sb_type_member;
}
Expand All @@ -524,7 +524,7 @@ SBTypeMember SBType::GetVirtualBaseClassAtIndex(uint32_t idx) {
idx, &bit_offset);
if (base_class_type.IsValid())
sb_type_member.reset(new TypeMemberImpl(
TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
std::make_shared<TypeImpl>(base_class_type), bit_offset));
}
return sb_type_member;
}
Expand All @@ -546,16 +546,15 @@ SBTypeEnumMemberList SBType::GetEnumMembers() {
if (IsValid()) {
CompilerType this_type(m_opaque_sp->GetCompilerType(true));
if (this_type.IsValid()) {
this_type.ForEachEnumerator([&sb_enum_member_list](
const CompilerType &integer_type,
ConstString name,
const llvm::APSInt &value) -> bool {
SBTypeEnumMember enum_member(
lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
sb_enum_member_list.Append(enum_member);
return true; // Keep iterating
});
this_type.ForEachEnumerator(
[&sb_enum_member_list](const CompilerType &integer_type,
ConstString name,
const llvm::APSInt &value) -> bool {
SBTypeEnumMember enum_member(std::make_shared<TypeEnumMemberImpl>(
std::make_shared<TypeImpl>(integer_type), name, value));
sb_enum_member_list.Append(enum_member);
return true; // Keep iterating
});
}
}
return sb_enum_member_list;
Expand All @@ -578,9 +577,9 @@ SBTypeMember SBType::GetFieldAtIndex(uint32_t idx) {
ConstString name;
if (!name_sstr.empty())
name.SetCString(name_sstr.c_str());
sb_type_member.reset(
new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type)), bit_offset,
name, bitfield_bit_size, is_bitfield));
sb_type_member.reset(new TypeMemberImpl(
std::make_shared<TypeImpl>(field_type), bit_offset, name,
bitfield_bit_size, is_bitfield));
}
}
}
Expand Down Expand Up @@ -978,7 +977,7 @@ SBType SBTypeMemberFunction::GetType() {

SBType sb_type;
if (m_opaque_sp) {
sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetType())));
sb_type.SetSP(std::make_shared<TypeImpl>(m_opaque_sp->GetType()));
}
return sb_type;
}
Expand All @@ -988,7 +987,7 @@ lldb::SBType SBTypeMemberFunction::GetReturnType() {

SBType sb_type;
if (m_opaque_sp) {
sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetReturnType())));
sb_type.SetSP(std::make_shared<TypeImpl>(m_opaque_sp->GetReturnType()));
}
return sb_type;
}
Expand All @@ -1007,7 +1006,7 @@ lldb::SBType SBTypeMemberFunction::GetArgumentTypeAtIndex(uint32_t i) {
SBType sb_type;
if (m_opaque_sp) {
sb_type.SetSP(
lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetArgumentAtIndex(i))));
std::make_shared<TypeImpl>(m_opaque_sp->GetArgumentAtIndex(i)));
}
return sb_type;
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBTypeFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace lldb_private;
SBTypeFilter::SBTypeFilter() { LLDB_INSTRUMENT_VA(this); }

SBTypeFilter::SBTypeFilter(uint32_t options)
: m_opaque_sp(TypeFilterImplSP(new TypeFilterImpl(options))) {
: m_opaque_sp(std::make_shared<TypeFilterImpl>(options)) {
LLDB_INSTRUMENT_VA(this, options);
}

Expand Down
4 changes: 2 additions & 2 deletions lldb/source/API/SBTypeNameSpecifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ SBTypeNameSpecifier::SBTypeNameSpecifier(SBType type) {
LLDB_INSTRUMENT_VA(this, type);

if (type.IsValid())
m_opaque_sp = TypeNameSpecifierImplSP(
new TypeNameSpecifierImpl(type.m_opaque_sp->GetCompilerType(true)));
m_opaque_sp = std::make_shared<TypeNameSpecifierImpl>(
type.m_opaque_sp->GetCompilerType(true));
}

SBTypeNameSpecifier::SBTypeNameSpecifier(const lldb::SBTypeNameSpecifier &rhs)
Expand Down
8 changes: 4 additions & 4 deletions lldb/source/API/SBTypeSynthetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ SBTypeSynthetic SBTypeSynthetic::CreateWithClassName(const char *data,

if (!data || data[0] == 0)
return SBTypeSynthetic();
return SBTypeSynthetic(ScriptedSyntheticChildrenSP(
new ScriptedSyntheticChildren(options, data, "")));
return SBTypeSynthetic(
std::make_shared<ScriptedSyntheticChildren>(options, data, ""));
}

SBTypeSynthetic SBTypeSynthetic::CreateWithScriptCode(const char *data,
Expand All @@ -34,8 +34,8 @@ SBTypeSynthetic SBTypeSynthetic::CreateWithScriptCode(const char *data,

if (!data || data[0] == 0)
return SBTypeSynthetic();
return SBTypeSynthetic(ScriptedSyntheticChildrenSP(
new ScriptedSyntheticChildren(options, "", data)));
return SBTypeSynthetic(
std::make_shared<ScriptedSyntheticChildren>(options, "", data));
}

SBTypeSynthetic::SBTypeSynthetic(const lldb::SBTypeSynthetic &rhs)
Expand Down
10 changes: 5 additions & 5 deletions lldb/source/API/SBValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,11 @@ void SBValue::SetSP(const lldb::ValueObjectSP &sp) {
lldb::DynamicValueType use_dynamic = target_sp->GetPreferDynamicValue();
bool use_synthetic =
target_sp->TargetProperties::GetEnableSyntheticValue();
m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
m_opaque_sp = std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic);
} else
m_opaque_sp = ValueImplSP(new ValueImpl(sp, eNoDynamicValues, true));
m_opaque_sp = std::make_shared<ValueImpl>(sp, eNoDynamicValues, true);
} else
m_opaque_sp = ValueImplSP(new ValueImpl(sp, eNoDynamicValues, false));
m_opaque_sp = std::make_shared<ValueImpl>(sp, eNoDynamicValues, false);
}

void SBValue::SetSP(const lldb::ValueObjectSP &sp,
Expand Down Expand Up @@ -1155,14 +1155,14 @@ void SBValue::SetSP(const lldb::ValueObjectSP &sp, bool use_synthetic) {

void SBValue::SetSP(const lldb::ValueObjectSP &sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic) {
m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
m_opaque_sp = std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic);
}

void SBValue::SetSP(const lldb::ValueObjectSP &sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic,
const char *name) {
m_opaque_sp =
ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic, name));
std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic, name);
}

bool SBValue::GetExpressionPath(SBStream &description) {
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Breakpoint/Breakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ StructuredData::ObjectSP Breakpoint::SerializeToStructuredData() {
if (!m_name_list.empty()) {
StructuredData::ArraySP names_array_sp(new StructuredData::Array());
for (auto name : m_name_list) {
names_array_sp->AddItem(
StructuredData::StringSP(new StructuredData::String(name)));
names_array_sp->AddItem(std::make_shared<StructuredData::String>(name));
}
breakpoint_contents_sp->AddItem(Breakpoint::GetKey(OptionNames::Names),
names_array_sp);
Expand Down
8 changes: 4 additions & 4 deletions lldb/source/Breakpoint/BreakpointResolverName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ StructuredData::ObjectSP BreakpointResolverName::SerializeToStructuredData() {
StructuredData::ArraySP names_sp(new StructuredData::Array());
StructuredData::ArraySP name_masks_sp(new StructuredData::Array());
for (auto lookup : m_lookups) {
names_sp->AddItem(StructuredData::StringSP(
new StructuredData::String(lookup.GetName().GetStringRef())));
name_masks_sp->AddItem(StructuredData::UnsignedIntegerSP(
new StructuredData::UnsignedInteger(lookup.GetNameTypeMask())));
names_sp->AddItem(std::make_shared<StructuredData::String>(
lookup.GetName().GetStringRef()));
name_masks_sp->AddItem(std::make_shared<StructuredData::UnsignedInteger>(
lookup.GetNameTypeMask()));
}
options_dict_sp->AddItem(GetKey(OptionNames::SymbolNameArray), names_sp);
options_dict_sp->AddItem(GetKey(OptionNames::NameMaskArray), name_masks_sp);
Expand Down
13 changes: 7 additions & 6 deletions lldb/source/Commands/CommandObjectCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "lldb/Utility/Args.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/StringRef.h"
#include <memory>
#include <optional>

using namespace lldb;
Expand Down Expand Up @@ -467,7 +468,7 @@ other command as far as there is only one alias command match.");
// Verify & handle any options/arguments passed to the alias command

OptionArgVectorSP option_arg_vector_sp =
OptionArgVectorSP(new OptionArgVector);
std::make_shared<OptionArgVector>();

const bool include_aliases = true;
// Look up the command using command's name first. This is to resolve
Expand Down Expand Up @@ -543,7 +544,7 @@ other command as far as there is only one alias command match.");
CommandObject *cmd_obj = command_obj_sp.get();
CommandObject *sub_cmd_obj = nullptr;
OptionArgVectorSP option_arg_vector_sp =
OptionArgVectorSP(new OptionArgVector);
std::make_shared<OptionArgVector>();

while (cmd_obj->IsMultiwordObject() && !args.empty()) {
auto sub_command = args[0].ref();
Expand Down Expand Up @@ -2504,9 +2505,9 @@ class CommandObjectCommandsScriptAdd : public CommandObjectParsed,

CommandObjectSP new_cmd_sp;
if (m_options.m_class_name.empty()) {
new_cmd_sp.reset(new CommandObjectPythonFunction(
new_cmd_sp = std::make_shared<CommandObjectPythonFunction>(
m_interpreter, m_cmd_name, m_options.m_funct_name,
m_options.m_short_help, m_synchronicity, m_completion_type));
m_options.m_short_help, m_synchronicity, m_completion_type);
} else {
ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter();
if (!interpreter) {
Expand All @@ -2528,9 +2529,9 @@ class CommandObjectCommandsScriptAdd : public CommandObjectParsed,
if (!result.Succeeded())
return;
} else
new_cmd_sp.reset(new CommandObjectScriptingObjectRaw(
new_cmd_sp = std::make_shared<CommandObjectScriptingObjectRaw>(
m_interpreter, m_cmd_name, cmd_obj_sp, m_synchronicity,
m_completion_type));
m_completion_type);
}

// Assume we're going to succeed...
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Commands/CommandObjectFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,9 @@ void CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
StackFrameRecognizerSP(new ScriptedStackFrameRecognizer(
interpreter, m_options.m_class_name.c_str()));
if (m_options.m_regex) {
auto module =
RegularExpressionSP(new RegularExpression(m_options.m_module));
auto module = std::make_shared<RegularExpression>(m_options.m_module);
auto func =
RegularExpressionSP(new RegularExpression(m_options.m_symbols.front()));
std::make_shared<RegularExpression>(m_options.m_symbols.front());
GetTarget().GetFrameRecognizerManager().AddRecognizer(
recognizer_sp, module, func, Mangled::NamePreference::ePreferDemangled,
m_options.m_first_instruction_only);
Expand Down
Loading
Loading