Index: lldb/source/API/SBCommandInterpreter.cpp =================================================================== --- lldb/source/API/SBCommandInterpreter.cpp +++ lldb/source/API/SBCommandInterpreter.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/lldb-types.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -555,8 +557,8 @@ 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( + *m_opaque_ptr, name, impl, help); if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true)) @@ -569,8 +571,8 @@ 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( + *m_opaque_ptr, name, impl, help, syntax); if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true)) @@ -631,8 +633,8 @@ 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( + 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 @@ 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( + 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(); Index: lldb/source/API/SBData.cpp =================================================================== --- lldb/source/API/SBData.cpp +++ lldb/source/API/SBData.cpp @@ -8,6 +8,8 @@ #include +#include + #include "lldb/API/SBData.h" #include "lldb/API/SBError.h" #include "lldb/API/SBStream.h" @@ -381,7 +383,7 @@ 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(buf, size, endian, addr_size); else { m_opaque_sp->SetData(buf, size, endian); @@ -530,8 +532,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); @@ -560,8 +562,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); @@ -592,8 +594,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); @@ -624,8 +626,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); @@ -656,8 +658,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); @@ -688,8 +690,8 @@ 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(buffer_sp, GetByteOrder(), + GetAddressByteSize()); else m_opaque_sp->SetData(buffer_sp); Index: lldb/source/API/SBInstruction.cpp =================================================================== --- lldb/source/API/SBInstruction.cpp +++ lldb/source/API/SBInstruction.cpp @@ -10,6 +10,8 @@ #include "lldb/API/SBAddress.h" #include "lldb/API/SBFrame.h" +#include + #include "lldb/API/SBInstruction.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBTarget.h" @@ -190,7 +192,7 @@ 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(disasm_sp, inst_sp); } bool SBInstruction::GetDescription(lldb::SBStream &s) { Index: lldb/source/API/SBThread.cpp =================================================================== --- lldb/source/API/SBThread.cpp +++ lldb/source/API/SBThread.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBThread.h" #include "lldb/API/SBFileSpec.h" @@ -290,7 +292,7 @@ SBThreadCollection SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared(); std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); Index: lldb/source/API/SBThreadPlan.cpp =================================================================== --- lldb/source/API/SBThreadPlan.cpp +++ lldb/source/API/SBThreadPlan.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBThread.h" #include "lldb/API/SBFileSpec.h" @@ -58,7 +60,7 @@ 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(*thread, class_name); } //---------------------------------------------------------------------- Index: lldb/source/API/SBTrace.cpp =================================================================== --- lldb/source/API/SBTrace.cpp +++ lldb/source/API/SBTrace.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/Process.h" #include "lldb/Utility/Log.h" @@ -92,7 +94,7 @@ } SBTrace::SBTrace() { - m_trace_impl_sp.reset(new TraceImpl); + m_trace_impl_sp = std::make_shared(); if (m_trace_impl_sp) m_trace_impl_sp->uid = LLDB_INVALID_UID; } Index: lldb/source/API/SBTraceOptions.cpp =================================================================== --- lldb/source/API/SBTraceOptions.cpp +++ lldb/source/API/SBTraceOptions.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBTraceOptions.h" #include "lldb/API/SBError.h" #include "lldb/API/SBStructuredData.h" @@ -17,7 +19,7 @@ using namespace lldb_private; SBTraceOptions::SBTraceOptions() { - m_traceoptions_sp.reset(new TraceOptions()); + m_traceoptions_sp = std::make_shared(); } lldb::TraceType SBTraceOptions::getType() const { Index: lldb/source/API/SBType.cpp =================================================================== --- lldb/source/API/SBType.cpp +++ lldb/source/API/SBType.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBType.h" #include "lldb/API/SBDefines.h" #include "lldb/API/SBStream.h" @@ -82,7 +84,7 @@ TypeImpl &SBType::ref() { if (m_opaque_sp.get() == NULL) - m_opaque_sp.reset(new TypeImpl()); + m_opaque_sp = std::make_shared(); return *m_opaque_sp; } @@ -670,7 +672,7 @@ TypeMemberFunctionImpl &SBTypeMemberFunction::ref() { if (!m_opaque_sp) - m_opaque_sp.reset(new TypeMemberFunctionImpl()); + m_opaque_sp = std::make_shared(); return *m_opaque_sp.get(); } Index: lldb/source/API/SBTypeEnumMember.cpp =================================================================== --- lldb/source/API/SBTypeEnumMember.cpp +++ lldb/source/API/SBTypeEnumMember.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBTypeEnumMember.h" #include "lldb/API/SBDefines.h" #include "lldb/API/SBStream.h" @@ -28,14 +30,14 @@ : m_opaque_sp() { if (this != &rhs) { if (rhs.IsValid()) - m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref())); + m_opaque_sp = std::make_shared(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(rhs.ref()); } return *this; } @@ -74,7 +76,7 @@ TypeEnumMemberImpl &SBTypeEnumMember::ref() { if (m_opaque_sp.get() == NULL) - m_opaque_sp.reset(new TypeEnumMemberImpl()); + m_opaque_sp = std::make_shared(); return *m_opaque_sp.get(); } Index: lldb/source/API/SBValue.cpp =================================================================== --- lldb/source/API/SBValue.cpp +++ lldb/source/API/SBValue.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBValue.h" #include "lldb/API/SBDeclaration.h" @@ -485,7 +487,7 @@ 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(value_sp->GetTypeImpl()); sb_type.SetSP(type_sp); } if (log) { Index: lldb/source/Breakpoint/Breakpoint.cpp =================================================================== --- lldb/source/Breakpoint/Breakpoint.cpp +++ lldb/source/Breakpoint/Breakpoint.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "llvm/Support/Casting.h" #include "lldb/Breakpoint/Breakpoint.h" @@ -158,8 +160,8 @@ SearchFilter::GetSerializationKey(), filter_dict); SearchFilterSP filter_sp; if (!success) - filter_sp.reset( - new SearchFilterForUnconstrainedSearches(target.shared_from_this())); + filter_sp = std::make_shared( + target.shared_from_this()); else { filter_sp = SearchFilter::CreateFromStructuredData(target, *filter_dict, create_error); Index: lldb/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include #include #include "CommandObjectBreakpoint.h" @@ -615,7 +616,7 @@ m_move_to_nearest_code = eLazyBoolCalculate; m_source_regex_func_names.clear(); m_python_class.clear(); - m_extra_args_sp.reset(new StructuredData::Dictionary()); + m_extra_args_sp = std::make_shared(); m_current_key.clear(); } Index: lldb/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/source/Commands/CommandObjectFrame.cpp +++ lldb/source/Commands/CommandObjectFrame.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include #include #include "CommandObjectFrame.h" @@ -526,9 +527,9 @@ ConstString(m_option_variable.summary.GetCurrentValue()), summary_format_sp); else if (!m_option_variable.summary_string.IsCurrentValueEmpty()) - summary_format_sp.reset(new StringSummaryFormat( + summary_format_sp = std::make_shared( TypeSummaryImpl::Flags(), - m_option_variable.summary_string.GetCurrentValue())); + m_option_variable.summary_string.GetCurrentValue()); DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions( eLanguageRuntimeDescriptionDisplayVerbosityFull, eFormatDefault, Index: lldb/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemory.cpp +++ lldb/source/Commands/CommandObjectMemory.cpp @@ -8,6 +8,8 @@ #include +#include + #include "clang/AST/Decl.h" #include "CommandObjectMemory.h" @@ -652,7 +654,7 @@ addr = addr + (*size * m_memory_options.m_offset.GetCurrentValue()); } else if (m_format_options.GetFormatValue().GetCurrentValue() != eFormatCString) { - data_sp.reset(new DataBufferHeap(total_byte_size, '\0')); + data_sp = std::make_shared(total_byte_size, '\0'); if (data_sp->GetBytes() == nullptr) { result.AppendErrorWithFormat( "can't allocate 0x%" PRIx32 @@ -692,8 +694,9 @@ item_byte_size = target->GetMaximumSizeOfStringSummary(); if (!m_format_options.GetCountValue().OptionWasSet()) item_count = 1; - data_sp.reset(new DataBufferHeap((item_byte_size + 1) * item_count, - '\0')); // account for NULLs as necessary + data_sp = std::make_shared( + (item_byte_size + 1) * item_count, + '\0'); // account for NULLs as necessary if (data_sp->GetBytes() == nullptr) { result.AppendErrorWithFormat( "can't allocate 0x%" PRIx64 @@ -740,7 +743,8 @@ if (break_on_no_NULL) break; } - data_sp.reset(new DataBufferHeap(data_sp->GetBytes(), bytes_read + 1)); + data_sp = + std::make_shared(data_sp->GetBytes(), bytes_read + 1); } m_next_addr = addr + bytes_read; Index: lldb/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/source/Commands/CommandObjectType.cpp +++ lldb/source/Commands/CommandObjectType.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "lldb/Core/Debugger.h" #include "lldb/Core/IOHandler.h" @@ -205,9 +206,9 @@ // for every type in the list TypeSummaryImplSP script_format; - script_format.reset(new ScriptSummaryFormat( + script_format = std::make_shared( options->m_flags, funct_name_str.c_str(), - lines.CopyList(" ").c_str())); + lines.CopyList(" ").c_str()); Status error; @@ -449,12 +450,12 @@ // class SyntheticChildrenSP synth_provider; - synth_provider.reset(new ScriptedSyntheticChildren( + synth_provider = std::make_shared( SyntheticChildren::Flags() .SetCascades(options->m_cascade) .SetSkipPointers(options->m_skip_pointers) .SetSkipReferences(options->m_skip_references), - class_name_str.c_str())); + class_name_str.c_str()); lldb::TypeCategoryImplSP category; DataVisualization::Categories::GetCategory( @@ -699,18 +700,18 @@ TypeFormatImplSP entry; if (m_command_options.m_custom_type_name.empty()) - entry.reset(new TypeFormatImpl_Format( + entry = std::make_shared( format, TypeFormatImpl::Flags() .SetCascades(m_command_options.m_cascade) .SetSkipPointers(m_command_options.m_skip_pointers) - .SetSkipReferences(m_command_options.m_skip_references))); + .SetSkipReferences(m_command_options.m_skip_references)); else - entry.reset(new TypeFormatImpl_EnumType( + entry = std::make_shared( ConstString(m_command_options.m_custom_type_name.c_str()), TypeFormatImpl::Flags() .SetCascades(m_command_options.m_cascade) .SetSkipPointers(m_command_options.m_skip_pointers) - .SetSkipReferences(m_command_options.m_skip_references))); + .SetSkipReferences(m_command_options.m_skip_references)); // now I have a valid format, let's add it to every type @@ -1352,8 +1353,8 @@ std::string code = (" " + m_options.m_python_function + "(valobj,internal_dict)"); - script_format.reset( - new ScriptSummaryFormat(m_options.m_flags, funct_name, code.c_str())); + script_format = std::make_shared( + m_options.m_flags, funct_name, code.c_str()); ScriptInterpreter *interpreter = m_interpreter.GetScriptInterpreter(); @@ -1389,8 +1390,8 @@ std::string code = " " + m_options.m_python_script; - script_format.reset(new ScriptSummaryFormat( - m_options.m_flags, funct_name_str.c_str(), code.c_str())); + script_format = std::make_shared( + m_options.m_flags, funct_name_str.c_str(), code.c_str()); } else { // Use an IOHandler to grab Python code from the user ScriptAddOptions *options = Index: lldb/source/Core/IOHandler.cpp =================================================================== --- lldb/source/Core/IOHandler.cpp +++ lldb/source/Core/IOHandler.cpp @@ -16,6 +16,7 @@ #if defined(__APPLE__) #include #endif +#include #include #include "lldb/Core/Debugger.h" @@ -995,16 +996,18 @@ bool make_active) { WindowSP subwindow_sp; if (m_window) { - subwindow_sp.reset(new Window( - name, ::subwin(m_window, bounds.size.height, bounds.size.width, - bounds.origin.y, bounds.origin.x), - true)); + subwindow_sp = std::make_shared( + name, + ::subwin(m_window, bounds.size.height, bounds.size.width, + bounds.origin.y, bounds.origin.x), + true); subwindow_sp->m_is_subwin = true; } else { - subwindow_sp.reset( - new Window(name, ::newwin(bounds.size.height, bounds.size.width, - bounds.origin.y, bounds.origin.x), - true)); + subwindow_sp = std::make_shared( + name, + ::newwin(bounds.size.height, bounds.size.width, bounds.origin.y, + bounds.origin.x), + true); subwindow_sp->m_is_subwin = false; } subwindow_sp->m_parent = this; @@ -1881,7 +1884,7 @@ WindowSP &GetMainWindow() { if (!m_window_sp) - m_window_sp.reset(new Window("main", stdscr, false)); + m_window_sp = std::make_shared("main", stdscr, false); return m_window_sp; } @@ -2508,7 +2511,7 @@ return; // Children are already up to date if (!m_frame_delegate_sp) { // Always expand the thread item the first time we show it - m_frame_delegate_sp.reset(new FrameTreeDelegate()); + m_frame_delegate_sp = std::make_shared(); } m_stop_id = process_sp->GetStopID(); @@ -2600,7 +2603,8 @@ if (!m_thread_delegate_sp) { // Always expand the thread item the first time we show it // item.Expand(); - m_thread_delegate_sp.reset(new ThreadTreeDelegate(m_debugger)); + m_thread_delegate_sp = + std::make_shared(m_debugger); } TreeItem t(&item, *m_thread_delegate_sp, false); Index: lldb/source/Core/ModuleList.cpp =================================================================== --- lldb/source/Core/ModuleList.cpp +++ lldb/source/Core/ModuleList.cpp @@ -87,7 +87,8 @@ } // namespace ModuleListProperties::ModuleListProperties() { - m_collection_sp.reset(new OptionValueProperties(ConstString("symbols"))); + m_collection_sp = + std::make_shared(ConstString("symbols")); m_collection_sp->Initialize(g_properties); llvm::SmallString<128> path; @@ -829,7 +830,7 @@ if (module_sp) return error; - module_sp.reset(new Module(module_spec)); + module_sp = std::make_shared(module_spec); // Make sure there are a module and an object file since we can specify a // valid file path with an architecture that might not be in that file. By // getting the object file we can guarantee that the architecture matches @@ -871,7 +872,7 @@ auto resolved_module_spec(module_spec); resolved_module_spec.GetFileSpec() = search_path_spec; - module_sp.reset(new Module(resolved_module_spec)); + module_sp = std::make_shared(resolved_module_spec); if (module_sp->GetObjectFile()) { // If we get in here we got the correct arch, now we just need to // verify the UUID if one was given @@ -970,7 +971,7 @@ } if (!module_sp) { - module_sp.reset(new Module(platform_module_spec)); + module_sp = std::make_shared(platform_module_spec); // Make sure there are a module and an object file since we can specify a // valid file path with an architecture that might not be in that file. // By getting the object file we can guarantee that the architecture Index: lldb/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/source/Core/ValueObject.cpp @@ -928,7 +928,7 @@ static bool CopyStringDataToBufferSP(const StreamString &source, lldb::DataBufferSP &destination) { - destination.reset(new DataBufferHeap(source.GetSize() + 1, 0)); + destination = std::make_shared(source.GetSize() + 1, 0); memcpy(destination->GetBytes(), source.GetString().data(), source.GetSize()); return true; } @@ -991,7 +991,7 @@ CopyStringDataToBufferSP(s, buffer_sp); return {0, was_capped}; } - buffer_sp.reset(new DataBufferHeap(cstr_len, 0)); + buffer_sp = std::make_shared(cstr_len, 0); memcpy(buffer_sp->GetBytes(), cstr, cstr_len); return {cstr_len, was_capped}; } else { @@ -1168,7 +1168,7 @@ if (my_format != m_last_format || m_value_str.empty()) { m_last_format = my_format; if (!format_sp) - format_sp.reset(new TypeFormatImpl_Format(my_format)); + format_sp = std::make_shared(my_format); if (GetValueAsCString(*format_sp.get(), m_value_str)) { if (!m_value_did_change && m_old_value_valid) { // The value was gotten successfully, so we consider the value as Index: lldb/source/DataFormatters/StringPrinter.cpp =================================================================== --- lldb/source/DataFormatters/StringPrinter.cpp +++ lldb/source/DataFormatters/StringPrinter.cpp @@ -20,6 +20,7 @@ #include #include +#include using namespace lldb; using namespace lldb_private; @@ -306,7 +307,8 @@ llvm::UTF8 *utf8_data_end_ptr = nullptr; if (ConvertFunction) { - utf8_data_buffer_sp.reset(new DataBufferHeap(4 * bufferSPSize, 0)); + utf8_data_buffer_sp = + std::make_shared(4 * bufferSPSize, 0); utf8_data_ptr = (llvm::UTF8 *)utf8_data_buffer_sp->GetBytes(); utf8_data_end_ptr = utf8_data_ptr + utf8_data_buffer_sp->GetByteSize(); ConvertFunction(&data_ptr, data_end_ptr, &utf8_data_ptr, Index: lldb/source/Expression/Materializer.cpp =================================================================== --- lldb/source/Expression/Materializer.cpp +++ lldb/source/Expression/Materializer.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Expression/Materializer.h" #include "lldb/Core/DumpDataExtractor.h" #include "lldb/Core/ValueObjectConstResult.h" @@ -560,8 +562,8 @@ m_temporary_allocation_size = data.GetByteSize(); - m_original_data.reset( - new DataBufferHeap(data.GetDataStart(), data.GetByteSize())); + m_original_data = std::make_shared(data.GetDataStart(), + data.GetByteSize()); if (!alloc_error.Success()) { err.SetErrorStringWithFormat( @@ -1215,8 +1217,8 @@ return; } - m_register_contents.reset(new DataBufferHeap(register_data.GetDataStart(), - register_data.GetByteSize())); + m_register_contents = std::make_shared( + register_data.GetDataStart(), register_data.GetByteSize()); Status write_error; Index: lldb/source/Expression/REPL.cpp =================================================================== --- lldb/source/Expression/REPL.cpp +++ lldb/source/Expression/REPL.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Expression/REPL.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/PluginManager.h" @@ -71,15 +73,15 @@ lldb::IOHandlerSP REPL::GetIOHandler() { if (!m_io_handler_sp) { Debugger &debugger = m_target.GetDebugger(); - m_io_handler_sp.reset( - new IOHandlerEditline(debugger, IOHandler::Type::REPL, - "lldb-repl", // Name of input reader for history - llvm::StringRef("> "), // prompt - llvm::StringRef(". "), // Continuation prompt - true, // Multi-line - true, // The REPL prompt is always colored - 1, // Line number - *this)); + m_io_handler_sp = std::make_shared( + debugger, IOHandler::Type::REPL, + "lldb-repl", // Name of input reader for history + llvm::StringRef("> "), // prompt + llvm::StringRef(". "), // Continuation prompt + true, // Multi-line + true, // The REPL prompt is always colored + 1, // Line number + *this); // Don't exit if CTRL+C is pressed static_cast(m_io_handler_sp.get()) Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -31,6 +31,7 @@ #include #endif +#include #include #include "llvm/Support/Errno.h" @@ -86,8 +87,8 @@ ConnectionFileDescriptor::ConnectionFileDescriptor(int fd, bool owns_fd) : Connection(), m_pipe(), m_mutex(), m_shutting_down(false), m_waiting_for_accept(false), m_child_processes_inherit(false) { - m_write_sp.reset(new File(fd, owns_fd)); - m_read_sp.reset(new File(fd, false)); + m_write_sp = std::make_shared(fd, owns_fd); + m_read_sp = std::make_shared(fd, false); Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); @@ -221,8 +222,8 @@ m_read_sp = std::move(tcp_socket); m_write_sp = m_read_sp; } else { - m_read_sp.reset(new File(fd, false)); - m_write_sp.reset(new File(fd, false)); + m_read_sp = std::make_shared(fd, false); + m_write_sp = std::make_shared(fd, false); } m_uri = *addr; return eConnectionStatusSuccess; @@ -271,8 +272,8 @@ ::fcntl(fd, F_SETFL, flags); } } - m_read_sp.reset(new File(fd, true)); - m_write_sp.reset(new File(fd, false)); + m_read_sp = std::make_shared(fd, true); + m_write_sp = std::make_shared(fd, false); return eConnectionStatusSuccess; } #endif Index: lldb/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/source/Interpreter/CommandInterpreter.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include #include #include #include @@ -366,7 +367,7 @@ if (cmd_obj_sp) AddAlias("image", cmd_obj_sp); - alias_arguments_vector_sp.reset(new OptionArgVector); + alias_arguments_vector_sp = std::make_shared(); cmd_obj_sp = GetCommandSPExact("expression", false); if (cmd_obj_sp) { @@ -392,7 +393,7 @@ cmd_obj_sp = GetCommandSPExact("process launch", false); if (cmd_obj_sp) { - alias_arguments_vector_sp.reset(new OptionArgVector); + alias_arguments_vector_sp = std::make_shared(); #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) AddAlias("r", cmd_obj_sp, "--"); AddAlias("run", cmd_obj_sp, "--"); @@ -2967,7 +2968,7 @@ flags = eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult; } - m_command_io_handler_sp.reset(new IOHandlerEditline( + m_command_io_handler_sp = std::make_shared( m_debugger, IOHandler::Type::CommandInterpreter, m_debugger.GetInputFile(), m_debugger.GetOutputFile(), m_debugger.GetErrorFile(), flags, "lldb", m_debugger.GetPrompt(), @@ -2975,7 +2976,7 @@ false, // Don't enable multiple line input, just single line commands m_debugger.GetUseColor(), 0, // Don't show line numbers - *this)); + *this); } return m_command_io_handler_sp; } Index: lldb/source/Interpreter/Property.cpp =================================================================== --- lldb/source/Interpreter/Property.cpp +++ lldb/source/Interpreter/Property.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Interpreter/Property.h" #include "lldb/Core/UserSettingsController.h" @@ -29,18 +31,20 @@ // "definition.default_uint_value" is not used // "definition.default_cstr_value" as a string value that represents the // default string value for the architecture/triple - m_value_sp.reset(new OptionValueArch(definition.default_cstr_value)); + m_value_sp = + std::make_shared(definition.default_cstr_value); break; case OptionValue::eTypeArgs: // "definition.default_uint_value" is always a OptionValue::Type - m_value_sp.reset(new OptionValueArgs()); + m_value_sp = std::make_shared(); break; case OptionValue::eTypeArray: // "definition.default_uint_value" is always a OptionValue::Type - m_value_sp.reset(new OptionValueArray(OptionValue::ConvertTypeToMask( - (OptionValue::Type)definition.default_uint_value))); + m_value_sp = + std::make_shared(OptionValue::ConvertTypeToMask( + (OptionValue::Type)definition.default_uint_value)); break; case OptionValue::eTypeBoolean: @@ -49,11 +53,12 @@ // "definition.default_cstr_value" as a string value that represents the // default value. if (definition.default_cstr_value) - m_value_sp.reset(new OptionValueBoolean(OptionArgParser::ToBoolean( - llvm::StringRef(definition.default_cstr_value), false, nullptr))); + m_value_sp = + std::make_shared(OptionArgParser::ToBoolean( + llvm::StringRef(definition.default_cstr_value), false, nullptr)); else - m_value_sp.reset( - new OptionValueBoolean(definition.default_uint_value != 0)); + m_value_sp = std::make_shared( + definition.default_uint_value != 0); break; case OptionValue::eTypeChar: { @@ -64,8 +69,9 @@ } case OptionValue::eTypeDictionary: // "definition.default_uint_value" is always a OptionValue::Type - m_value_sp.reset(new OptionValueDictionary(OptionValue::ConvertTypeToMask( - (OptionValue::Type)definition.default_uint_value))); + m_value_sp = + std::make_shared(OptionValue::ConvertTypeToMask( + (OptionValue::Type)definition.default_uint_value)); break; case OptionValue::eTypeEnum: @@ -100,14 +106,14 @@ FileSpec file_spec = FileSpec(definition.default_cstr_value); if (resolve) FileSystem::Instance().Resolve(file_spec); - m_value_sp.reset(new OptionValueFileSpec(file_spec, resolve)); + m_value_sp = std::make_shared(file_spec, resolve); break; } case OptionValue::eTypeFileSpecList: // "definition.default_uint_value" is not used for a // OptionValue::eTypeFileSpecList - m_value_sp.reset(new OptionValueFileSpecList()); + m_value_sp = std::make_shared(); break; case OptionValue::eTypeFormat: @@ -122,7 +128,7 @@ nullptr); else new_format = (Format)definition.default_uint_value; - m_value_sp.reset(new OptionValueFormat(new_format)); + m_value_sp = std::make_shared(new_format); } break; @@ -138,29 +144,30 @@ llvm::StringRef(definition.default_cstr_value)); else new_lang = (LanguageType)definition.default_uint_value; - m_value_sp.reset(new OptionValueLanguage(new_lang)); + m_value_sp = std::make_shared(new_lang); } break; case OptionValue::eTypeFormatEntity: // "definition.default_cstr_value" as a string value that represents the // default - m_value_sp.reset( - new OptionValueFormatEntity(definition.default_cstr_value)); + m_value_sp = std::make_shared( + definition.default_cstr_value); break; case OptionValue::eTypePathMap: // "definition.default_uint_value" tells us if notifications should occur // for path mappings - m_value_sp.reset( - new OptionValuePathMappings(definition.default_uint_value != 0)); + m_value_sp = std::make_shared( + definition.default_uint_value != 0); break; case OptionValue::eTypeRegex: // "definition.default_uint_value" is used to the regular expression flags // "definition.default_cstr_value" the default regular expression value // value. - m_value_sp.reset(new OptionValueRegex(definition.default_cstr_value)); + m_value_sp = + std::make_shared(definition.default_cstr_value); break; case OptionValue::eTypeSInt64: @@ -168,10 +175,10 @@ // "definition.default_cstr_value" is NULL, otherwise interpret // "definition.default_cstr_value" as a string value that represents the // default value. - m_value_sp.reset(new OptionValueSInt64( + m_value_sp = std::make_shared( definition.default_cstr_value ? StringConvert::ToSInt64(definition.default_cstr_value) - : definition.default_uint_value)); + : definition.default_uint_value); break; case OptionValue::eTypeUInt64: @@ -179,10 +186,10 @@ // "definition.default_cstr_value" is NULL, otherwise interpret // "definition.default_cstr_value" as a string value that represents the // default value. - m_value_sp.reset(new OptionValueUInt64( + m_value_sp = std::make_shared( definition.default_cstr_value ? StringConvert::ToUInt64(definition.default_cstr_value) - : definition.default_uint_value)); + : definition.default_uint_value); break; case OptionValue::eTypeUUID: @@ -192,7 +199,7 @@ UUID uuid; if (definition.default_cstr_value) uuid.SetFromStringRef(definition.default_cstr_value); - m_value_sp.reset(new OptionValueUUID(uuid)); + m_value_sp = std::make_shared(uuid); } break; Index: lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -31,6 +31,8 @@ #include "DynamicLoaderDarwinKernel.h" +#include + //#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN #ifdef ENABLE_DEBUG_PRINTF #include @@ -87,7 +89,7 @@ } DynamicLoaderDarwinKernelProperties() : Properties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -112,7 +114,7 @@ static const DynamicLoaderDarwinKernelPropertiesSP &GetGlobalProperties() { static DynamicLoaderDarwinKernelPropertiesSP g_settings_sp; if (!g_settings_sp) - g_settings_sp.reset(new DynamicLoaderDarwinKernelProperties()); + g_settings_sp = std::make_shared(); return g_settings_sp; } @@ -791,8 +793,8 @@ if (IsKernel()) { if (Symbols::DownloadObjectAndSymbolFile(module_spec, true)) { if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) { - m_module_sp.reset(new Module(module_spec.GetFileSpec(), - target.GetArchitecture())); + m_module_sp = std::make_shared(module_spec.GetFileSpec(), + target.GetArchitecture()); if (m_module_sp.get() && m_module_sp->MatchesModuleSpec(module_spec)) { ModuleList loaded_module_list; Index: lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp +++ lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp @@ -20,6 +20,8 @@ #include "DynamicLoaderHexagonDYLD.h" +#include + using namespace lldb; using namespace lldb_private; @@ -454,7 +456,8 @@ llvm::sort(start, end); addrs.erase(std::unique(start, end), end); - thread_plan_sp.reset(new ThreadPlanRunToAddress(thread, addrs, stop)); + thread_plan_sp = + std::make_shared(thread, addrs, stop); } return thread_plan_sp; Index: lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -44,6 +44,8 @@ #include "Utility/UuidCompatibility.h" #else #include + +#include #endif using namespace lldb; @@ -939,8 +941,8 @@ load_addrs.push_back(address.GetLoadAddress(target_sp.get())); } } - thread_plan_sp.reset( - new ThreadPlanRunToAddress(thread, load_addrs, stop_others)); + thread_plan_sp = std::make_shared( + thread, load_addrs, stop_others); } } else { if (log) Index: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -9,6 +9,8 @@ // Main header include #include "DynamicLoaderPOSIXDYLD.h" +#include + #include "AuxVector.h" #include "lldb/Breakpoint/BreakpointLocation.h" @@ -497,7 +499,8 @@ llvm::sort(start, end); addrs.erase(std::unique(start, end), end); - thread_plan_sp.reset(new ThreadPlanRunToAddress(thread, addrs, stop)); + thread_plan_sp = + std::make_shared(thread, addrs, stop); } return thread_plan_sp; Index: lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -26,6 +26,7 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/RecordLayout.h" +#include #include using namespace clang; @@ -707,7 +708,7 @@ return; // otherwise we may need to fall back } - context.m_namespace_map.reset(new ClangASTImporter::NamespaceMap); + context.m_namespace_map = std::make_shared(); if (const NamespaceDecl *namespace_context = dyn_cast(context.m_decl_context)) { Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include #include "clang/AST/ASTContext.h" #include "clang/AST/ASTDiagnostic.h" #include "clang/AST/ExternalASTSource.h" @@ -35,6 +34,8 @@ #include "clang/Sema/CodeCompleteConsumer.h" #include "clang/Sema/Sema.h" #include "clang/Sema/SemaConsumer.h" +#include +#include #include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" @@ -1104,11 +1105,11 @@ custom_passes.EarlyPasses->run(*llvm_module_ap); } - execution_unit_sp.reset( - new IRExecutionUnit(m_llvm_context, // handed off here - llvm_module_ap, // handed off here - function_name, exe_ctx.GetTargetSP(), sc, - m_compiler->getTargetOpts().Features)); + execution_unit_sp = std::make_shared( + m_llvm_context, // handed off here + llvm_module_ap, // handed off here + function_name, exe_ctx.GetTargetSP(), sc, + m_compiler->getTargetOpts().Features); ClangExpressionHelper *type_system_helper = dyn_cast(m_expr.GetTypeSystemHelper()); Index: lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp +++ lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp @@ -8,6 +8,8 @@ #include "MainThreadCheckerRuntime.h" +#include + #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -238,8 +240,8 @@ MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); - + threads = std::make_shared(); + ProcessSP process_sp = GetProcessSP(); if (info->GetObjectForDotSeparatedPath("instrumentation_class") Index: lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp +++ lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp @@ -8,6 +8,8 @@ #include "TSanRuntime.h" +#include + #include "Plugins/Process/Utility/HistoryThread.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Core/Debugger.h" @@ -1050,7 +1052,7 @@ ThreadSanitizerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared(); if (info->GetObjectForDotSeparatedPath("instrumentation_class") ->GetStringValue() != "ThreadSanitizer") Index: lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp +++ lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp @@ -31,6 +31,8 @@ #include "lldb/Utility/Stream.h" #include +#include + using namespace lldb; using namespace lldb_private; @@ -303,7 +305,7 @@ UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared(); ProcessSP process_sp = GetProcessSP(); Index: lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp =================================================================== --- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -29,6 +29,8 @@ #include "JITLoaderGDB.h" +#include + using namespace lldb; using namespace lldb_private; @@ -70,7 +72,7 @@ } PluginProperties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -402,7 +404,7 @@ JITLoaderSP jit_loader_sp; ArchSpec arch(process->GetTarget().GetArchitecture()); if (arch.GetTriple().getVendor() != llvm::Triple::Apple) - jit_loader_sp.reset(new JITLoaderGDB(process)); + jit_loader_sp = std::make_shared(process); return jit_loader_sp; } Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -31,6 +31,7 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" +#include #include using namespace lldb; @@ -111,10 +112,10 @@ BreakpointResolverSP resolver_sp; if (throw_bp) - resolver_sp.reset(new BreakpointResolverName( + resolver_sp = std::make_shared( bkpt, std::get<1>(GetExceptionThrowLocation()).AsCString(), eFunctionNameTypeBase, eLanguageTypeUnknown, Breakpoint::Exact, 0, - eLazyBoolNo)); + eLazyBoolNo); // FIXME: don't do catch yet. return resolver_sp; } Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -8,6 +8,7 @@ #include +#include #include #include @@ -803,10 +804,10 @@ BreakpointResolverSP resolver_sp; if (throw_bp) - resolver_sp.reset(new BreakpointResolverName( + resolver_sp = std::make_shared( bkpt, std::get<1>(GetExceptionThrowLocation()).AsCString(), eFunctionNameTypeBase, eLanguageTypeUnknown, Breakpoint::Exact, 0, - eLazyBoolNo)); + eLazyBoolNo); // FIXME: We don't do catch breakpoints for ObjC yet. // Should there be some way for the runtime to specify what it can do in this // regard? @@ -2549,7 +2550,8 @@ ObjCLanguageRuntime::EncodingToTypeSP AppleObjCRuntimeV2::GetEncodingToType() { if (!m_encoding_to_type_sp) - m_encoding_to_type_sp.reset(new AppleObjCTypeEncodingParser(*this)); + m_encoding_to_type_sp = + std::make_shared(*this); return m_encoding_to_type_sp; } Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -9,6 +9,8 @@ #include "AppleObjCTrampolineHandler.h" +#include + #include "AppleThreadPlanStepThroughObjCTrampoline.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" @@ -1048,8 +1050,8 @@ log->Printf("Found implementation address in cache: 0x%" PRIx64, impl_addr); - ret_plan_sp.reset( - new ThreadPlanRunToAddress(thread, impl_addr, stop_others)); + ret_plan_sp = std::make_shared(thread, impl_addr, + stop_others); } else { // We haven't seen this class/selector pair yet. Look it up. StreamString errors; @@ -1128,9 +1130,9 @@ // is not safe to run only one thread. So we override the // stop_others value passed in to us here: const bool trampoline_stop_others = false; - ret_plan_sp.reset(new AppleThreadPlanStepThroughObjCTrampoline( + ret_plan_sp = std::make_shared( thread, this, dispatch_values, isa_addr, sel_addr, - trampoline_stop_others)); + trampoline_stop_others); if (log) { StreamString s; ret_plan_sp->GetDescription(&s, eDescriptionLevelFull); Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "AppleThreadPlanStepThroughObjCTrampoline.h" + #include "AppleObjCTrampolineHandler.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -19,6 +20,7 @@ #include "lldb/Target/ThreadPlanRunToAddress.h" #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Utility/Log.h" +#include using namespace lldb; using namespace lldb_private; @@ -183,8 +185,8 @@ // Extract the target address from the value: - m_run_to_sp.reset( - new ThreadPlanRunToAddress(m_thread, target_so_addr, m_stop_others)); + m_run_to_sp = std::make_shared( + m_thread, target_so_addr, m_stop_others); m_thread.QueueThreadPlan(m_run_to_sp, false); m_run_to_sp->SetPrivate(true); return false; Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -9,7 +9,9 @@ #include "llvm/ADT/StringSwitch.h" #include "RenderScriptRuntime.h" + #include "RenderScriptScriptGroup.h" +#include #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Core/Debugger.h" @@ -1211,7 +1213,7 @@ } } if (!group) { - group.reset(new RSScriptGroupDescriptor); + group = std::make_shared(); group->m_name = group_name; m_scriptGroups.push_back(group); } else { @@ -2854,7 +2856,7 @@ switch (GetModuleKind(module_sp)) { case eModuleKindKernelObj: { RSModuleDescriptorSP module_desc; - module_desc.reset(new RSModuleDescriptor(module_sp)); + module_desc = std::make_shared(module_sp); if (module_desc->ParseRSInfo()) { m_rsmodules.push_back(module_desc); module_desc->WarnIfVersionMismatch(GetProcess() Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -57,6 +57,8 @@ #include "Utility/UuidCompatibility.h" #else #include + +#include #endif #define THUMB_ADDRESS_BIT_MASK 0xfffffffffffffffeull @@ -1645,7 +1647,7 @@ // conflict with any of the sections. SectionSP segment_sp; if (add_section && (const_segname || is_core)) { - segment_sp.reset(new Section( + segment_sp = std::make_shared
( module_sp, // Module to which this section belongs this, // Object file to which this sections belongs ++context.NextSegmentIdx @@ -1662,8 +1664,8 @@ // the file load_cmd.filesize, // Size in bytes of this section as found // in the file - 0, // Segments have no alignment information - load_cmd.flags)); // Flags for this section + 0, // Segments have no alignment information + load_cmd.flags); // Flags for this section segment_sp->SetIsEncrypted(segment_is_encrypted); m_sections_ap->AddSection(segment_sp); @@ -1784,7 +1786,7 @@ } } else { // Create a fake section for the section's named segment - segment_sp.reset(new Section( + segment_sp = std::make_shared
( segment_sp, // Parent section module_sp, // Module to which this section belongs this, // Object file to which this section belongs @@ -1805,7 +1807,7 @@ // this section as // found in the file sect64.align, - load_cmd.flags)); // Flags for this section + load_cmd.flags); // Flags for this section segment_sp->SetIsFake(true); segment_sp->SetPermissions(segment_permissions); m_sections_ap->AddSection(segment_sp); @@ -5527,19 +5529,23 @@ switch (m_header.cputype) { case llvm::MachO::CPU_TYPE_ARM64: - reg_ctx_sp.reset(new RegisterContextDarwin_arm64_Mach(thread, data)); + reg_ctx_sp = + std::make_shared(thread, data); break; case llvm::MachO::CPU_TYPE_ARM: - reg_ctx_sp.reset(new RegisterContextDarwin_arm_Mach(thread, data)); + reg_ctx_sp = + std::make_shared(thread, data); break; case llvm::MachO::CPU_TYPE_I386: - reg_ctx_sp.reset(new RegisterContextDarwin_i386_Mach(thread, data)); + reg_ctx_sp = + std::make_shared(thread, data); break; case llvm::MachO::CPU_TYPE_X86_64: - reg_ctx_sp.reset(new RegisterContextDarwin_x86_64_Mach(thread, data)); + reg_ctx_sp = + std::make_shared(thread, data); break; } } Index: lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp =================================================================== --- lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -9,6 +9,7 @@ #ifndef LLDB_DISABLE_PYTHON #include "OperatingSystemPython.h" + #include "Plugins/Process/Utility/DynamicRegisterInfo.h" #include "Plugins/Process/Utility/RegisterContextDummy.h" #include "Plugins/Process/Utility/RegisterContextMemory.h" @@ -30,6 +31,7 @@ #include "lldb/Utility/RegisterValue.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/StructuredData.h" +#include using namespace lldb; using namespace lldb_private; @@ -259,8 +261,8 @@ if (!thread_sp) { if (did_create_ptr) *did_create_ptr = true; - thread_sp.reset( - new ThreadMemory(*m_process, tid, name, queue, reg_data_addr)); + thread_sp = std::make_shared(*m_process, tid, name, queue, + reg_data_addr); } if (core_number < core_thread_list.GetSize(false)) { @@ -321,8 +323,8 @@ "= 0x%" PRIx64 ", 0x%" PRIx64 ", reg_data_addr = 0x%" PRIx64 ") creating memory register context", thread->GetID(), thread->GetProtocolID(), reg_data_addr); - reg_ctx_sp.reset(new RegisterContextMemory( - *thread, 0, *GetDynamicRegisterInfo(), reg_data_addr)); + reg_ctx_sp = std::make_shared( + *thread, 0, *GetDynamicRegisterInfo(), reg_data_addr); } else { // No register data address is provided, query the python plug-in to let it // make up the data as it sees fit @@ -355,8 +357,8 @@ log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid " "= 0x%" PRIx64 ") forcing a dummy register context", thread->GetID()); - reg_ctx_sp.reset(new RegisterContextDummy( - *thread, 0, target.GetArchitecture().GetAddressByteSize())); + reg_ctx_sp = std::make_shared( + *thread, 0, target.GetArchitecture().GetAddressByteSize()); } return reg_ctx_sp; } Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include "lldb/Breakpoint/BreakpointLocation.h" @@ -262,7 +263,7 @@ module_spec.GetFileSpec().GetFilename().AsCString()); ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); + module_sp = std::make_shared(local_spec); module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); return Status(); } @@ -300,7 +301,7 @@ } ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); + module_sp = std::make_shared(local_spec); module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); if (log) @@ -328,7 +329,7 @@ module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); + module_sp = std::make_shared(local_spec); module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); return Status(); } else Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -35,6 +35,8 @@ #include +#include + #include "Host/macosx/cfcpp/CFCBundle.h" using namespace lldb; @@ -200,7 +202,7 @@ } PlatformDarwinKernelProperties() : Properties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -228,7 +230,7 @@ static const PlatformDarwinKernelPropertiesSP &GetGlobalProperties() { static PlatformDarwinKernelPropertiesSP g_settings_sp; if (!g_settings_sp) - g_settings_sp.reset(new PlatformDarwinKernelProperties()); + g_settings_sp = std::make_shared(); return g_settings_sp; } Index: lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp =================================================================== --- lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include "lldb/Core/Debugger.h" @@ -63,7 +64,7 @@ } PluginProperties() : Properties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -81,7 +82,7 @@ static const ProcessKDPPropertiesSP &GetGlobalPluginProperties() { static ProcessKDPPropertiesSP g_settings_sp; if (!g_settings_sp) - g_settings_sp.reset(new PluginProperties()); + g_settings_sp = std::make_shared(); return g_settings_sp; } @@ -108,7 +109,7 @@ const FileSpec *crash_file_path) { lldb::ProcessSP process_sp; if (crash_file_path == NULL) - process_sp.reset(new ProcessKDP(target_sp, listener_sp)); + process_sp = std::make_shared(target_sp, listener_sp); return process_sp; } @@ -505,7 +506,7 @@ ThreadSP thread_sp(m_kernel_thread_wp.lock()); if (!thread_sp) { - thread_sp.reset(new ThreadKDP(*this, g_kernel_tid)); + thread_sp = std::make_shared(*this, g_kernel_tid); m_kernel_thread_wp = thread_sp; } return thread_sp; @@ -1030,7 +1031,7 @@ CommandObject *ProcessKDP::GetPluginCommandObject() { if (!m_command_sp) - m_command_sp.reset(new CommandObjectMultiwordProcessKDP( - GetTarget().GetDebugger().GetCommandInterpreter())); + m_command_sp = std::make_shared( + GetTarget().GetDebugger().GetCommandInterpreter()); return m_command_sp.get(); } Index: lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp =================================================================== --- lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -8,6 +8,8 @@ #include "ThreadKDP.h" +#include + #include "lldb/Host/SafeMachO.h" #include "lldb/Breakpoint/Watchpoint.h" @@ -98,19 +100,20 @@ ->GetCommunication() .GetCPUType()) { case llvm::MachO::CPU_TYPE_ARM: - reg_ctx_sp.reset(new RegisterContextKDP_arm(*this, concrete_frame_idx)); + reg_ctx_sp = + std::make_shared(*this, concrete_frame_idx); break; case llvm::MachO::CPU_TYPE_ARM64: - reg_ctx_sp.reset( - new RegisterContextKDP_arm64(*this, concrete_frame_idx)); + reg_ctx_sp = std::make_shared( + *this, concrete_frame_idx); break; case llvm::MachO::CPU_TYPE_I386: - reg_ctx_sp.reset( - new RegisterContextKDP_i386(*this, concrete_frame_idx)); + reg_ctx_sp = std::make_shared( + *this, concrete_frame_idx); break; case llvm::MachO::CPU_TYPE_X86_64: - reg_ctx_sp.reset( - new RegisterContextKDP_x86_64(*this, concrete_frame_idx)); + reg_ctx_sp = std::make_shared( + *this, concrete_frame_idx); break; default: llvm_unreachable("Add CPU type support in KDP"); Index: lldb/source/Plugins/Process/Utility/HistoryThread.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/HistoryThread.cpp +++ lldb/source/Plugins/Process/Utility/HistoryThread.cpp @@ -9,8 +9,10 @@ #include "lldb/lldb-private.h" #include "Plugins/Process/Utility/HistoryThread.h" + #include "Plugins/Process/Utility/HistoryUnwind.h" #include "Plugins/Process/Utility/RegisterContextHistory.h" +#include #include "lldb/Target/Process.h" #include "lldb/Target/StackFrameList.h" @@ -48,8 +50,8 @@ lldb::RegisterContextSP HistoryThread::GetRegisterContext() { RegisterContextSP rctx; if (m_pcs.size() > 0) { - rctx.reset(new RegisterContextHistory( - *this, 0, GetProcess()->GetAddressByteSize(), m_pcs[0])); + rctx = std::make_shared( + *this, 0, GetProcess()->GetAddressByteSize(), m_pcs[0]); } return rctx; } @@ -64,7 +66,8 @@ std::unique_lock lock(m_framelist_mutex); lock.unlock(); if (m_framelist.get() == NULL) { - m_framelist.reset(new StackFrameList(*this, StackFrameListSP(), true)); + m_framelist = + std::make_shared(*this, StackFrameListSP(), true); } return m_framelist; Index: lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp +++ lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp @@ -9,7 +9,9 @@ #include "lldb/lldb-private.h" #include "Plugins/Process/Utility/HistoryUnwind.h" + #include "Plugins/Process/Utility/RegisterContextHistory.h" +#include #include "lldb/Target/Process.h" #include "lldb/Target/StackFrame.h" @@ -42,9 +44,9 @@ addr_t pc = frame->GetFrameCodeAddress().GetLoadAddress( &frame->GetThread()->GetProcess()->GetTarget()); if (pc != LLDB_INVALID_ADDRESS) { - rctx.reset(new RegisterContextHistory( + rctx = std::make_shared( *frame->GetThread().get(), frame->GetConcreteFrameIndex(), - frame->GetThread()->GetProcess()->GetAddressByteSize(), pc)); + frame->GetThread()->GetProcess()->GetAddressByteSize(), pc); } } return rctx; Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "RegisterContextDarwin_arm.h" + #include "RegisterContextDarwinConstants.h" +#include #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" @@ -1296,7 +1298,7 @@ bool RegisterContextDarwin_arm::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { - data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0)); + data_sp = std::make_shared(REG_CONTEXT_SIZE, 0); if (data_sp && ReadGPR(false) == KERN_SUCCESS && ReadFPU(false) == KERN_SUCCESS && ReadEXC(false) == KERN_SUCCESS) { uint8_t *dst = data_sp->GetBytes(); Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp @@ -8,7 +8,9 @@ //===----------------------------------------------------------------------===// #include "RegisterContextDarwin_arm64.h" + #include "RegisterContextDarwinConstants.h" +#include #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" @@ -648,7 +650,7 @@ bool RegisterContextDarwin_arm64::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { - data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0)); + data_sp = std::make_shared(REG_CONTEXT_SIZE, 0); if (data_sp && ReadGPR(false) == KERN_SUCCESS && ReadFPU(false) == KERN_SUCCESS && ReadEXC(false) == KERN_SUCCESS) { uint8_t *dst = data_sp->GetBytes(); Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp @@ -8,6 +8,8 @@ #include +#include + #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" @@ -831,7 +833,7 @@ bool RegisterContextDarwin_i386::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { - data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0)); + data_sp = std::make_shared(REG_CONTEXT_SIZE, 0); if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) { uint8_t *dst = data_sp->GetBytes(); Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" @@ -909,7 +911,7 @@ bool RegisterContextDarwin_x86_64::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { - data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0)); + data_sp = std::make_shared(REG_CONTEXT_SIZE, 0); if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) { uint8_t *dst = data_sp->GetBytes(); Index: lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -34,6 +34,8 @@ #include "RegisterContextLLDB.h" +#include + using namespace lldb; using namespace lldb_private; @@ -369,7 +371,8 @@ if (abi) { m_fast_unwind_plan_sp.reset(); - m_full_unwind_plan_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + m_full_unwind_plan_sp = + std::make_shared(lldb::eRegisterKindGeneric); abi->CreateDefaultUnwindPlan(*m_full_unwind_plan_sp); if (m_frame_type != eSkipFrame) // don't override eSkipFrame { @@ -716,8 +719,8 @@ Process *process = exe_ctx.GetProcessPtr(); ABI *abi = process ? process->GetABI().get() : NULL; if (abi) { - arch_default_unwind_plan_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + arch_default_unwind_plan_sp = + std::make_shared(lldb::eRegisterKindGeneric); abi->CreateDefaultUnwindPlan(*arch_default_unwind_plan_sp); } else { UnwindLogMsg( @@ -752,7 +755,8 @@ process->GetLoadAddressPermissions(current_pc_addr, permissions) && (permissions & ePermissionsExecutable) == 0)) { if (abi) { - unwind_plan_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + unwind_plan_sp = + std::make_shared(lldb::eRegisterKindGeneric); abi->CreateFunctionEntryUnwindPlan(*unwind_plan_sp); m_frame_type = eNormalFrame; return unwind_plan_sp; @@ -793,7 +797,7 @@ DWARFCallFrameInfo *eh_frame = pc_module_sp->GetObjectFile()->GetUnwindTable().GetEHFrameInfo(); if (eh_frame) { - unwind_plan_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + unwind_plan_sp = std::make_shared(lldb::eRegisterKindGeneric); if (eh_frame->GetUnwindPlan(m_current_pc, *unwind_plan_sp)) return unwind_plan_sp; else @@ -803,7 +807,7 @@ ArmUnwindInfo *arm_exidx = pc_module_sp->GetObjectFile()->GetUnwindTable().GetArmUnwindInfo(); if (arm_exidx) { - unwind_plan_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + unwind_plan_sp = std::make_shared(lldb::eRegisterKindGeneric); if (arm_exidx->GetUnwindPlan(exe_ctx.GetTargetRef(), m_current_pc, *unwind_plan_sp)) return unwind_plan_sp; Index: lldb/source/Plugins/Process/Utility/ThreadMemory.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/ThreadMemory.cpp +++ lldb/source/Plugins/Process/Utility/ThreadMemory.cpp @@ -8,12 +8,14 @@ //===----------------------------------------------------------------------===// #include "Plugins/Process/Utility/ThreadMemory.h" + #include "Plugins/Process/Utility/RegisterContextThreadMemory.h" #include "lldb/Target/OperatingSystem.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Unwind.h" +#include using namespace lldb; using namespace lldb_private; @@ -44,8 +46,8 @@ RegisterContextSP ThreadMemory::GetRegisterContext() { if (!m_reg_context_sp) - m_reg_context_sp.reset( - new RegisterContextThreadMemory(*this, m_register_data_addr)); + m_reg_context_sp = std::make_shared( + *this, m_register_data_addr); return m_reg_context_sp; } Index: lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp +++ lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Symbol/Function.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Symbol.h" @@ -65,8 +67,8 @@ uint32_t concrete_idx = frame->GetConcreteFrameIndex(); const uint32_t frame_count = GetFrameCount(); if (concrete_idx < frame_count) - reg_ctx_sp.reset(new RegisterContextMacOSXFrameBackchain( - m_thread, concrete_idx, m_cursors[concrete_idx])); + reg_ctx_sp = std::make_shared( + m_thread, concrete_idx, m_cursors[concrete_idx]); return reg_ctx_sp; } Index: lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -8,6 +8,7 @@ #include +#include #include #include "lldb/Core/Module.h" @@ -65,8 +66,8 @@ lldb::offset_t data_offset = 0; if (elf_header.Parse(data, &data_offset)) { if (elf_header.e_type == llvm::ELF::ET_CORE) - process_sp.reset( - new ProcessElfCore(target_sp, listener_sp, *crash_file)); + process_sp = std::make_shared(target_sp, listener_sp, + *crash_file); } } } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp @@ -8,6 +8,8 @@ #include "RegisterContextPOSIXCore_arm.h" +#include + #include "lldb/Target/Thread.h" #include "lldb/Utility/RegisterValue.h" @@ -17,8 +19,8 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_arm(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp @@ -7,9 +7,11 @@ //===----------------------------------------------------------------------===// #include "RegisterContextPOSIXCore_arm64.h" + #include "Plugins/Process/elf-core/RegisterUtilities.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/RegisterValue.h" +#include using namespace lldb_private; @@ -17,8 +19,8 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_arm64(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp @@ -8,6 +8,8 @@ #include "RegisterContextPOSIXCore_mips64.h" +#include + #include "lldb/Target/Thread.h" #include "lldb/Utility/RegisterValue.h" @@ -17,15 +19,15 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_mips64(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); DataExtractor fpregset = getRegset( notes, register_info->GetTargetArchitecture().GetTriple(), FPR_Desc); - m_fpr_buffer.reset( - new DataBufferHeap(fpregset.GetDataStart(), fpregset.GetByteSize())); + m_fpr_buffer = std::make_shared(fpregset.GetDataStart(), + fpregset.GetByteSize()); m_fpr.SetData(m_fpr_buffer); m_fpr.SetByteOrder(fpregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp @@ -8,6 +8,8 @@ #include "RegisterContextPOSIXCore_powerpc.h" +#include + #include "lldb/Target/Thread.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/RegisterValue.h" @@ -18,21 +20,21 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_powerpc(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); ArchSpec arch = register_info->GetTargetArchitecture(); DataExtractor fpregset = getRegset(notes, arch.GetTriple(), FPR_Desc); - m_fpr_buffer.reset( - new DataBufferHeap(fpregset.GetDataStart(), fpregset.GetByteSize())); + m_fpr_buffer = std::make_shared(fpregset.GetDataStart(), + fpregset.GetByteSize()); m_fpr.SetData(m_fpr_buffer); m_fpr.SetByteOrder(fpregset.GetByteOrder()); DataExtractor vregset = getRegset(notes, arch.GetTriple(), PPC_VMX_Desc); - m_vec_buffer.reset( - new DataBufferHeap(vregset.GetDataStart(), vregset.GetByteSize())); + m_vec_buffer = std::make_shared(vregset.GetDataStart(), + vregset.GetByteSize()); m_vec.SetData(m_vec_buffer); m_vec.SetByteOrder(vregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp @@ -8,6 +8,8 @@ #include "RegisterContextPOSIXCore_ppc64le.h" +#include + #include "lldb/Target/Thread.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/RegisterValue.h" @@ -21,27 +23,27 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_ppc64le(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); ArchSpec arch = register_info->GetTargetArchitecture(); DataExtractor fpregset = getRegset(notes, arch.GetTriple(), FPR_Desc); - m_fpr_buffer.reset( - new DataBufferHeap(fpregset.GetDataStart(), fpregset.GetByteSize())); + m_fpr_buffer = std::make_shared(fpregset.GetDataStart(), + fpregset.GetByteSize()); m_fpr.SetData(m_fpr_buffer); m_fpr.SetByteOrder(fpregset.GetByteOrder()); DataExtractor vmxregset = getRegset(notes, arch.GetTriple(), PPC_VMX_Desc); - m_vmx_buffer.reset( - new DataBufferHeap(vmxregset.GetDataStart(), vmxregset.GetByteSize())); + m_vmx_buffer = std::make_shared(vmxregset.GetDataStart(), + vmxregset.GetByteSize()); m_vmx.SetData(m_vmx_buffer); m_vmx.SetByteOrder(vmxregset.GetByteOrder()); DataExtractor vsxregset = getRegset(notes, arch.GetTriple(), PPC_VSX_Desc); - m_vsx_buffer.reset( - new DataBufferHeap(vsxregset.GetDataStart(), vsxregset.GetByteSize())); + m_vsx_buffer = std::make_shared(vsxregset.GetDataStart(), + vsxregset.GetByteSize()); m_vsx.SetData(m_vsx_buffer); m_vsx.SetByteOrder(vsxregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp +++ lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp @@ -8,6 +8,8 @@ #include "RegisterContextPOSIXCore_s390x.h" +#include + #include "lldb/Target/Thread.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/RegisterValue.h" @@ -18,15 +20,15 @@ Thread &thread, RegisterInfoInterface *register_info, const DataExtractor &gpregset, llvm::ArrayRef notes) : RegisterContextPOSIX_s390x(thread, 0, register_info) { - m_gpr_buffer.reset( - new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize())); + m_gpr_buffer = std::make_shared(gpregset.GetDataStart(), + gpregset.GetByteSize()); m_gpr.SetData(m_gpr_buffer); m_gpr.SetByteOrder(gpregset.GetByteOrder()); DataExtractor fpregset = getRegset( notes, register_info->GetTargetArchitecture().GetTriple(), FPR_Desc); - m_fpr_buffer.reset( - new DataBufferHeap(fpregset.GetDataStart(), fpregset.GetByteSize())); + m_fpr_buffer = std::make_shared(fpregset.GetDataStart(), + fpregset.GetByteSize()); m_fpr.SetData(m_fpr_buffer); m_fpr.SetByteOrder(fpregset.GetByteOrder()); } Index: lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp =================================================================== --- lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -38,6 +38,8 @@ #include "RegisterContextPOSIXCore_x86_64.h" #include "ThreadElfCore.h" +#include + using namespace lldb; using namespace lldb_private; @@ -186,40 +188,40 @@ switch (arch.GetMachine()) { case llvm::Triple::aarch64: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_arm64( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::arm: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_arm( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::mipsel: case llvm::Triple::mips: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_mips64( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::mips64: case llvm::Triple::mips64el: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_mips64( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::ppc: case llvm::Triple::ppc64: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_powerpc( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::ppc64le: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_ppc64le( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::systemz: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_s390x( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; case llvm::Triple::x86: case llvm::Triple::x86_64: - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_x86_64( - *this, reg_interface, m_gpregset_data, m_notes)); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, m_gpregset_data, m_notes); break; default: break; Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -8,6 +8,8 @@ #include "GDBRemoteRegisterContext.h" +#include + #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferHeap.h" @@ -488,8 +490,8 @@ // ReadRegisterBytes saves the contents of the register in to the // m_reg_data buffer } - data_sp.reset(new DataBufferHeap(m_reg_data.GetDataStart(), - m_reg_info.GetRegisterDataByteSize())); + data_sp = std::make_shared( + m_reg_data.GetDataStart(), m_reg_info.GetRegisterDataByteSize()); return true; } else { Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -124,7 +125,7 @@ } PluginProperties() : Properties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -152,7 +153,7 @@ static const ProcessKDPPropertiesSP &GetGlobalPluginProperties() { static ProcessKDPPropertiesSP g_settings_sp; if (!g_settings_sp) - g_settings_sp.reset(new PluginProperties()); + g_settings_sp = std::make_shared(); return g_settings_sp; } @@ -246,7 +247,7 @@ const FileSpec *crash_file_path) { lldb::ProcessSP process_sp; if (crash_file_path == NULL) - process_sp.reset(new ProcessGDBRemote(target_sp, listener_sp)); + process_sp = std::make_shared(target_sp, listener_sp); return process_sp; } @@ -1708,7 +1709,7 @@ ThreadSP thread_sp( old_thread_list_copy.RemoveThreadByProtocolID(tid, false)); if (!thread_sp) { - thread_sp.reset(new ThreadGDBRemote(*this, tid)); + thread_sp = std::make_shared(*this, tid); LLDB_LOGV(log, "Making new thread: {0} for thread ID: {1:x}.", thread_sp.get(), thread_sp->GetID()); } else { @@ -1824,7 +1825,7 @@ if (!thread_sp) { // Create the thread if we need to - thread_sp.reset(new ThreadGDBRemote(*this, tid)); + thread_sp = std::make_shared(*this, tid); m_thread_list_real.AddThread(thread_sp); } } @@ -4060,8 +4061,8 @@ if (m_gdb_comm.SendPacketsAndConcatenateResponses("qXfer:auxv:read::", response_string) == GDBRemoteCommunication::PacketResult::Success) - buf.reset(new DataBufferHeap(response_string.c_str(), - response_string.length())); + buf = std::make_shared(response_string.c_str(), + response_string.length()); } return buf; } @@ -5424,7 +5425,7 @@ CommandObject *ProcessGDBRemote::GetPluginCommandObject() { if (!m_command_sp) - m_command_sp.reset(new CommandObjectMultiwordProcessGDBRemote( - GetTarget().GetDebugger().GetCommandInterpreter())); + m_command_sp = std::make_shared( + GetTarget().GetDebugger().GetCommandInterpreter()); return m_command_sp.get(); } Index: lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -8,6 +8,8 @@ #include "ThreadGDBRemote.h" +#include + #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" @@ -307,9 +309,9 @@ // supported. bool read_all_registers_at_once = !gdb_process->GetGDBRemote().GetpPacketSupported(GetID()); - reg_ctx_sp.reset(new GDBRemoteRegisterContext( + reg_ctx_sp = std::make_shared( *this, concrete_frame_idx, gdb_process->m_register_info, - read_all_registers_at_once)); + read_all_registers_at_once); } } else { Unwind *unwinder = GetUnwinder(); Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp =================================================================== --- lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -12,6 +12,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Threading.h" +#include #include #include "lldb/Core/Debugger.h" @@ -70,8 +71,8 @@ llvm::MachO::mach_header mach_header; if (ObjectFileMachO::ParseHeader(data, &data_offset, mach_header)) { if (mach_header.filetype == llvm::MachO::MH_CORE) - process_sp.reset( - new ProcessMachCore(target_sp, listener_sp, *crash_file)); + process_sp = std::make_shared(target_sp, listener_sp, + *crash_file); } } } Index: lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp =================================================================== --- lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp +++ lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "ProcessMinidump.h" + #include "ThreadMinidump.h" +#include #include "lldb/Core/DumpDataExtractor.h" #include "lldb/Core/Module.h" @@ -644,7 +646,7 @@ CommandObject *ProcessMinidump::GetPluginCommandObject() { if (!m_command_sp) - m_command_sp.reset(new CommandObjectMultiwordProcessMinidump( - GetTarget().GetDebugger().GetCommandInterpreter())); + m_command_sp = std::make_shared( + GetTarget().GetDebugger().GetCommandInterpreter()); return m_command_sp.get(); } Index: lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp =================================================================== --- lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp +++ lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "ThreadMinidump.h" + #include "ProcessMinidump.h" +#include #include "RegisterContextMinidump_ARM.h" #include "RegisterContextMinidump_ARM64.h" @@ -71,8 +73,9 @@ lldb::DataBufferSP buf = ConvertMinidumpContext_x86_32(m_gpregset_data, reg_interface); DataExtractor gpregset(buf, lldb::eByteOrderLittle, 4); - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_x86_64( - *this, reg_interface, gpregset, {})); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, gpregset, + llvm::ArrayRef()); break; } case llvm::Triple::x86_64: { @@ -80,22 +83,24 @@ lldb::DataBufferSP buf = ConvertMinidumpContext_x86_64(m_gpregset_data, reg_interface); DataExtractor gpregset(buf, lldb::eByteOrderLittle, 8); - m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_x86_64( - *this, reg_interface, gpregset, {})); + m_thread_reg_ctx_sp = std::make_shared( + *this, reg_interface, gpregset, + llvm::ArrayRef()); break; } case llvm::Triple::aarch64: { DataExtractor data(m_gpregset_data.data(), m_gpregset_data.size(), lldb::eByteOrderLittle, 8); - m_thread_reg_ctx_sp.reset(new RegisterContextMinidump_ARM64(*this, data)); + m_thread_reg_ctx_sp = + std::make_shared(*this, data); break; } case llvm::Triple::arm: { DataExtractor data(m_gpregset_data.data(), m_gpregset_data.size(), lldb::eByteOrderLittle, 8); const bool apple = arch.GetTriple().getVendor() == llvm::Triple::Apple; - m_thread_reg_ctx_sp.reset( - new RegisterContextMinidump_ARM(*this, data, apple)); + m_thread_reg_ctx_sp = + std::make_shared(*this, data, apple); break; } default: Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp =================================================================== --- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -811,7 +812,7 @@ join_read_thread = true; FILE *outfile_handle = fdopen(pipe.ReleaseWriteFileDescriptor(), "w"); - output_file_sp.reset(new StreamFile(outfile_handle, true)); + output_file_sp = std::make_shared(outfile_handle, true); error_file_sp = output_file_sp; if (outfile_handle) ::setbuf(outfile_handle, nullptr); @@ -827,12 +828,12 @@ debugger.AdoptTopIOHandlerFilesIfInvalid(input_file_sp, output_file_sp, error_file_sp); } else { - input_file_sp.reset(new StreamFile()); + input_file_sp = std::make_shared(); FileSystem::Instance().Open(input_file_sp->GetFile(), FileSpec(FileSystem::DEV_NULL), File::eOpenOptionRead); - output_file_sp.reset(new StreamFile()); + output_file_sp = std::make_shared(); FileSystem::Instance().Open(output_file_sp->GetFile(), FileSpec(FileSystem::DEV_NULL), File::eOpenOptionWrite); @@ -2220,7 +2221,7 @@ } if (new_callee && old_callee != new_callee) - callee_wrapper_sp.reset(new StructuredPythonObject(new_callee)); + callee_wrapper_sp = std::make_shared(new_callee); return ret_val; } @@ -2879,7 +2880,7 @@ ScriptInterpreter::eScriptReturnTypeOpaqueObject, &module_pyobj) && module_pyobj) - module_sp->reset(new StructuredPythonObject(module_pyobj)); + *module_sp = std::make_shared(module_pyobj); } return true; Index: lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp =================================================================== --- lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -12,6 +12,7 @@ #include // C++ includes +#include #include #include "lldb/Breakpoint/StoppointCallbackContext.h" @@ -144,7 +145,7 @@ } StructuredDataDarwinLogProperties() : Properties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -171,7 +172,7 @@ static const StructuredDataDarwinLogPropertiesSP &GetGlobalProperties() { static StructuredDataDarwinLogPropertiesSP g_settings_sp; if (!g_settings_sp) - g_settings_sp.reset(new StructuredDataDarwinLogProperties()); + g_settings_sp = std::make_shared(); return g_settings_sp; } Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -43,6 +43,7 @@ #include "clang/AST/DeclTemplate.h" #include +#include #include //#define ENABLE_DEBUG_PRINTF // COMMENT OUT THIS LINE PRIOR TO CHECKIN @@ -522,10 +523,10 @@ } } - type_sp.reset( - new Type(die.GetID(), dwarf, type_name_const_str, byte_size, NULL, - DIERef(encoding_uid).GetUID(dwarf), encoding_data_type, - &decl, clang_type, resolve_state)); + type_sp = std::make_shared( + die.GetID(), dwarf, type_name_const_str, byte_size, nullptr, + DIERef(encoding_uid).GetUID(dwarf), encoding_data_type, &decl, + clang_type, resolve_state); dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get(); } break; @@ -842,10 +843,10 @@ // parameters in any class methods need it for the clang types for // function prototypes. LinkDeclContextToDIE(m_ast.GetDeclContextForType(clang_type), die); - type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, - byte_size, NULL, LLDB_INVALID_UID, - Type::eEncodingIsUID, &decl, clang_type, - Type::eResolveStateForward)); + type_sp = std::make_shared( + die.GetID(), dwarf, type_name_const_str, byte_size, nullptr, + LLDB_INVALID_UID, Type::eEncodingIsUID, &decl, clang_type, + Type::eResolveStateForward); type_sp->SetIsCompleteObjCClass(is_complete_objc_class); @@ -1102,10 +1103,10 @@ LinkDeclContextToDIE( ClangASTContext::GetDeclContextForType(clang_type), die); - type_sp.reset(new Type( - die.GetID(), dwarf, type_name_const_str, byte_size, NULL, + type_sp = std::make_shared( + die.GetID(), dwarf, type_name_const_str, byte_size, nullptr, DIERef(encoding_form).GetUID(dwarf), Type::eEncodingIsUID, &decl, - clang_type, Type::eResolveStateForward)); + clang_type, Type::eResolveStateForward); if (ClangASTContext::StartTagDeclarationDefinition(clang_type)) { if (die.HasChildren()) { @@ -1651,10 +1652,10 @@ } } } - type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, - llvm::None, NULL, LLDB_INVALID_UID, - Type::eEncodingIsUID, &decl, clang_type, - Type::eResolveStateFull)); + type_sp = std::make_shared( + die.GetID(), dwarf, type_name_const_str, llvm::None, nullptr, + LLDB_INVALID_UID, Type::eEncodingIsUID, &decl, clang_type, + Type::eResolveStateFull); assert(type_sp.get()); } break; @@ -1802,10 +1803,11 @@ m_ast.CreateArrayType(array_element_type, 0, is_vector); } ConstString empty_name; - type_sp.reset(new Type( + type_sp = std::make_shared( die.GetID(), dwarf, empty_name, array_element_bit_stride / 8, - NULL, DIERef(type_die_form).GetUID(dwarf), Type::eEncodingIsUID, - &decl, clang_type, Type::eResolveStateFull)); + nullptr, DIERef(type_die_form).GetUID(dwarf), + Type::eEncodingIsUID, &decl, clang_type, + Type::eResolveStateFull); type_sp->SetEncodingType(element_type); m_ast.SetMetadataAsUserID(clang_type.GetOpaqueQualType(), die.GetID()); @@ -1849,10 +1851,10 @@ if (llvm::Optional clang_type_size = clang_type.GetByteSize(nullptr)) { byte_size = *clang_type_size; - type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, - byte_size, NULL, LLDB_INVALID_UID, - Type::eEncodingIsUID, NULL, clang_type, - Type::eResolveStateForward)); + type_sp = std::make_shared( + die.GetID(), dwarf, type_name_const_str, byte_size, nullptr, + LLDB_INVALID_UID, Type::eEncodingIsUID, nullptr, clang_type, + Type::eResolveStateForward); } } @@ -2652,10 +2654,11 @@ if (dwarf->FixupAddress(func_range.GetBaseAddress())) { const user_id_t func_user_id = die.GetID(); - func_sp.reset(new Function(&comp_unit, - func_user_id, // UserID is the DIE offset - func_user_id, func_name, func_type, - func_range)); // first address range + func_sp = + std::make_shared(&comp_unit, + func_user_id, // UserID is the DIE offset + func_user_id, func_name, func_type, + func_range); // first address range if (func_sp.get() != NULL) { if (frame_base.IsValid()) Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -11,6 +11,8 @@ //#define ENABLE_DEBUG_PRINTF // DO NOT LEAVE THIS DEFINED: DEBUG ONLY!!! #include +#include + #include "lldb/Core/FileSpecList.h" #include "lldb/Core/Module.h" #include "lldb/Host/Host.h" @@ -48,7 +50,7 @@ // DEBUG_PRINTF("m_lineTableMap[0x%8.8x] = line_table_sp\n", // debug_line_offset); m_lineTableMap[debug_line_offset] = line_table_sp; - line_table_sp.reset(new LineTable); + line_table_sp = std::make_shared(); } else ++offset; // Try next byte in line table } Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -73,6 +73,7 @@ #include "llvm/Support/FileSystem.h" #include +#include #include #include @@ -130,7 +131,7 @@ } PluginProperties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); } @@ -770,9 +771,9 @@ cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0)); bool is_optimized = dwarf_cu->GetIsOptimized(); - cu_sp.reset(new CompileUnit( + cu_sp = std::make_shared( module_sp, dwarf_cu, cu_file_spec, dwarf_cu->GetID(), - cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo)); + cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo); if (cu_sp) { // If we just created a compile unit with an invalid file spec, // try and get the first entry in the supports files from the @@ -3126,7 +3127,7 @@ VariableListSP variables(sc.comp_unit->GetVariableList(false)); if (variables.get() == NULL) { - variables.reset(new VariableList()); + variables = std::make_shared(); sc.comp_unit->SetVariableList(variables); DIEArray die_offsets; @@ -3540,10 +3541,10 @@ type_sp->GetType()->GetByteSize().getValueOr(0), die.GetCU()->GetAddressByteSize()); - var_sp.reset(new Variable(die.GetID(), name, mangled, type_sp, scope, - symbol_context_scope, scope_ranges, &decl, - location, is_external, is_artificial, - is_static_member)); + var_sp = std::make_shared( + die.GetID(), name, mangled, type_sp, scope, symbol_context_scope, + scope_ranges, &decl, location, is_external, is_artificial, + is_static_member); var_sp->SetLocationIsConstantValueData(location_is_const_value_data); } else { @@ -3641,7 +3642,7 @@ if (sc.comp_unit != NULL) { variable_list_sp = sc.comp_unit->GetVariableList(false); if (variable_list_sp.get() == NULL) { - variable_list_sp.reset(new VariableList()); + variable_list_sp = std::make_shared(); } } else { GetObjectFile()->GetModule()->ReportError( @@ -3680,7 +3681,7 @@ const bool can_create = false; variable_list_sp = block->GetBlockVariableList(can_create); if (variable_list_sp.get() == NULL) { - variable_list_sp.reset(new VariableList()); + variable_list_sp = std::make_shared(); block->SetVariableList(variable_list_sp); } } Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -8,6 +8,8 @@ #include "SymbolFileDWARFDebugMap.h" +#include + #include "DWARFDebugAranges.h" #include "lldb/Core/Module.h" @@ -411,7 +413,7 @@ comp_unit_info->oso_sp = pos->second; } else { ObjectFile *obj_file = GetObjectFile(); - comp_unit_info->oso_sp.reset(new OSOInfo()); + comp_unit_info->oso_sp = std::make_shared(); m_oso_map[{comp_unit_info->oso_path, comp_unit_info->oso_mod_time}] = comp_unit_info->oso_sp; const char *oso_path = comp_unit_info->oso_path.GetCString(); @@ -455,11 +457,10 @@ .getArchName() .str() .c_str()); - comp_unit_info->oso_sp->module_sp.reset(new DebugMapModule( + comp_unit_info->oso_sp->module_sp = std::make_shared( obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file, - oso_arch, oso_object ? &oso_object : NULL, 0, - oso_object ? comp_unit_info->oso_mod_time - : llvm::sys::TimePoint<>())); + oso_arch, oso_object ? &oso_object : nullptr, 0, + oso_object ? comp_unit_info->oso_mod_time : llvm::sys::TimePoint<>()); } } if (comp_unit_info->oso_sp) @@ -581,9 +582,10 @@ // User zero as the ID to match the compile unit at offset zero in each // .o file since each .o file can only have one compile unit for now. lldb::user_id_t cu_id = 0; - m_compile_unit_infos[cu_idx].compile_unit_sp.reset( - new CompileUnit(m_obj_file->GetModule(), NULL, so_file_spec, cu_id, - eLanguageTypeUnknown, eLazyBoolCalculate)); + m_compile_unit_infos[cu_idx].compile_unit_sp = + std::make_shared( + m_obj_file->GetModule(), nullptr, so_file_spec, cu_id, + eLanguageTypeUnknown, eLazyBoolCalculate); if (m_compile_unit_infos[cu_idx].compile_unit_sp) { // Let our symbol vendor know about this compile unit Index: lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "SymbolFileSymtab.h" + #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Symbol/CompileUnit.h" @@ -18,6 +19,7 @@ #include "lldb/Symbol/TypeList.h" #include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/Timer.h" +#include using namespace lldb; using namespace lldb_private; @@ -123,9 +125,9 @@ const Symbol *cu_symbol = m_obj_file->GetSymtab()->SymbolAtIndex(m_source_indexes[idx]); if (cu_symbol) - cu_sp.reset(new CompileUnit(m_obj_file->GetModule(), NULL, - cu_symbol->GetName().AsCString(), 0, - eLanguageTypeUnknown, eLazyBoolNo)); + cu_sp = std::make_shared(m_obj_file->GetModule(), nullptr, + cu_symbol->GetName().AsCString(), 0, + eLanguageTypeUnknown, eLazyBoolNo); } return cu_sp; } Index: lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -29,6 +29,8 @@ #include "SystemRuntimeMacOSX.h" +#include + using namespace lldb; using namespace lldb_private; @@ -495,9 +497,9 @@ bool stop_id_is_valid = true; if (item.stop_id == 0) stop_id_is_valid = false; - originating_thread_sp.reset(new HistoryThread( + originating_thread_sp = std::make_shared( *m_process, item.enqueuing_thread_id, item.enqueuing_callstack, - item.stop_id, stop_id_is_valid)); + item.stop_id, stop_id_is_valid); originating_thread_sp->SetExtendedBacktraceToken( item.item_that_enqueued_this); originating_thread_sp->SetQueueName( @@ -540,9 +542,9 @@ bool stop_id_is_valid = true; if (item.stop_id == 0) stop_id_is_valid = false; - return_thread_sp.reset(new HistoryThread( + return_thread_sp = std::make_shared( *m_process, item.enqueuing_thread_id, item.enqueuing_callstack, - item.stop_id, stop_id_is_valid)); + item.stop_id, stop_id_is_valid); return_thread_sp->SetExtendedBacktraceToken(item.item_that_enqueued_this); return_thread_sp->SetQueueName(item.enqueuing_queue_label.c_str()); return_thread_sp->SetQueueID(item.enqueuing_queue_serialnum); @@ -567,10 +569,10 @@ if (queue_item_sp->GetStopID() == 0) stop_id_is_valid = false; - extended_thread_sp.reset( - new HistoryThread(*m_process, queue_item_sp->GetEnqueueingThreadID(), - queue_item_sp->GetEnqueueingBacktrace(), - queue_item_sp->GetStopID(), stop_id_is_valid)); + extended_thread_sp = std::make_shared( + *m_process, queue_item_sp->GetEnqueueingThreadID(), + queue_item_sp->GetEnqueueingBacktrace(), queue_item_sp->GetStopID(), + stop_id_is_valid); extended_thread_sp->SetExtendedBacktraceToken( queue_item_sp->GetItemThatEnqueuedThis()); extended_thread_sp->SetQueueName(queue_item_sp->GetQueueLabel().c_str()); Index: lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp =================================================================== --- lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp +++ lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp @@ -8,6 +8,8 @@ #include "x86AssemblyInspectionEngine.h" +#include + #include "llvm-c/Disassembler.h" #include "lldb/Core/Address.h" @@ -1172,7 +1174,7 @@ *new_row = *original_last_row; new_row->SetOffset(offset); unwind_plan.AppendRow(new_row); - row.reset(new UnwindPlan::Row()); + row = std::make_shared(); *row = *new_row; reinstate_unwind_state = false; unwind_plan_updated = true; Index: lldb/source/Symbol/Block.cpp =================================================================== --- lldb/source/Symbol/Block.cpp +++ lldb/source/Symbol/Block.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Symbol/Block.h" #include "lldb/Core/Module.h" @@ -363,8 +365,8 @@ void Block::SetInlinedFunctionInfo(const char *name, const char *mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr) { - m_inlineInfoSP.reset( - new InlineFunctionInfo(name, mangled, decl_ptr, call_decl_ptr)); + m_inlineInfoSP = std::make_shared(name, mangled, decl_ptr, + call_decl_ptr); } VariableListSP Block::GetBlockVariableList(bool can_create) { Index: lldb/source/Symbol/ClangASTImporter.cpp =================================================================== --- lldb/source/Symbol/ClangASTImporter.cpp +++ lldb/source/Symbol/ClangASTImporter.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Symbol/ClangASTImporter.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/ClangASTContext.h" @@ -765,7 +767,7 @@ NamespaceMapSP new_map; - new_map.reset(new NamespaceMap); + new_map = std::make_shared(); if (context_md->m_map_completer) { std::string namespace_string = decl->getDeclName().getAsString(); Index: lldb/source/Symbol/CompactUnwindInfo.cpp =================================================================== --- lldb/source/Symbol/CompactUnwindInfo.cpp +++ lldb/source/Symbol/CompactUnwindInfo.cpp @@ -18,6 +18,7 @@ #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" #include +#include #include "llvm/Support/MathExtras.h" @@ -263,8 +264,8 @@ // have a live process and can read them out of memory. if (process_sp.get() == nullptr) return; - m_section_contents_if_encrypted.reset( - new DataBufferHeap(m_section_sp->GetByteSize(), 0)); + m_section_contents_if_encrypted = + std::make_shared(m_section_sp->GetByteSize(), 0); Status error; if (process_sp->ReadMemory( m_section_sp->GetLoadBaseAddress(&process_sp->GetTarget()), Index: lldb/source/Symbol/FuncUnwinders.cpp =================================================================== --- lldb/source/Symbol/FuncUnwinders.cpp +++ lldb/source/Symbol/FuncUnwinders.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Symbol/FuncUnwinders.h" #include "lldb/Core/Address.h" #include "lldb/Core/AddressRange.h" @@ -110,8 +112,8 @@ current_pc.SetOffset(current_pc.GetOffset() + current_offset); DWARFCallFrameInfo *eh_frame = m_unwind_table.GetEHFrameInfo(); if (eh_frame) { - m_unwind_plan_eh_frame_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_eh_frame_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!eh_frame->GetUnwindPlan(current_pc, *m_unwind_plan_eh_frame_sp)) m_unwind_plan_eh_frame_sp.reset(); } @@ -132,8 +134,8 @@ current_pc.SetOffset(current_pc.GetOffset() + current_offset); DWARFCallFrameInfo *debug_frame = m_unwind_table.GetDebugFrameInfo(); if (debug_frame) { - m_unwind_plan_debug_frame_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_debug_frame_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!debug_frame->GetUnwindPlan(current_pc, *m_unwind_plan_debug_frame_sp)) m_unwind_plan_debug_frame_sp.reset(); @@ -155,8 +157,8 @@ current_pc.SetOffset(current_pc.GetOffset() + current_offset); ArmUnwindInfo *arm_unwind_info = m_unwind_table.GetArmUnwindInfo(); if (arm_unwind_info) { - m_unwind_plan_arm_unwind_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_arm_unwind_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!arm_unwind_info->GetUnwindPlan(target, current_pc, *m_unwind_plan_arm_unwind_sp)) m_unwind_plan_arm_unwind_sp.reset(); @@ -189,7 +191,8 @@ if (!eh_frame_plan) return m_unwind_plan_eh_frame_augmented_sp; - m_unwind_plan_eh_frame_augmented_sp.reset(new UnwindPlan(*eh_frame_plan)); + m_unwind_plan_eh_frame_augmented_sp = + std::make_shared(*eh_frame_plan); // Augment the eh_frame instructions with epilogue descriptions if necessary // so the UnwindPlan can be used at any instruction in the function. @@ -231,8 +234,8 @@ if (!debug_frame_plan) return m_unwind_plan_debug_frame_augmented_sp; - m_unwind_plan_debug_frame_augmented_sp.reset( - new UnwindPlan(*debug_frame_plan)); + m_unwind_plan_debug_frame_augmented_sp = + std::make_shared(*debug_frame_plan); // Augment the debug_frame instructions with epilogue descriptions if // necessary so the UnwindPlan can be used at any instruction in the @@ -262,7 +265,8 @@ UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) { - m_unwind_plan_assembly_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_assembly_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!assembly_profiler_sp->GetNonCallSiteUnwindPlanFromAssembly( m_range, thread, *m_unwind_plan_assembly_sp)) { m_unwind_plan_assembly_sp.reset(); @@ -364,7 +368,8 @@ UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) { - m_unwind_plan_fast_sp.reset(new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_fast_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!assembly_profiler_sp->GetFastUnwindPlan(m_range, thread, *m_unwind_plan_fast_sp)) { m_unwind_plan_fast_sp.reset(); @@ -385,8 +390,8 @@ if (process_sp) { ABI *abi = process_sp->GetABI().get(); if (abi) { - m_unwind_plan_arch_default_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_arch_default_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!abi->CreateDefaultUnwindPlan(*m_unwind_plan_arch_default_sp)) { m_unwind_plan_arch_default_sp.reset(); } @@ -410,8 +415,8 @@ if (process_sp) { ABI *abi = process_sp->GetABI().get(); if (abi) { - m_unwind_plan_arch_default_at_func_entry_sp.reset( - new UnwindPlan(lldb::eRegisterKindGeneric)); + m_unwind_plan_arch_default_at_func_entry_sp = + std::make_shared(lldb::eRegisterKindGeneric); if (!abi->CreateFunctionEntryUnwindPlan( *m_unwind_plan_arch_default_at_func_entry_sp)) { m_unwind_plan_arch_default_at_func_entry_sp.reset(); Index: lldb/source/Target/CPPLanguageRuntime.cpp =================================================================== --- lldb/source/Target/CPPLanguageRuntime.cpp +++ lldb/source/Target/CPPLanguageRuntime.cpp @@ -11,6 +11,8 @@ #include +#include + #include "llvm/ADT/StringRef.h" #include "lldb/Symbol/Block.h" @@ -327,16 +329,16 @@ value_sp->GetValueIsValid()) { // We found the std::function wrapped callable and we have its address. // We now create a ThreadPlan to run to the callable. - ret_plan_sp.reset(new ThreadPlanRunToAddress( - thread, callable_info.callable_address, stop_others)); + ret_plan_sp = std::make_shared( + thread, callable_info.callable_address, stop_others); return ret_plan_sp; } else { // We are in std::function but we could not obtain the callable. // We create a ThreadPlan to keep stepping through using the address range // of the current function. - ret_plan_sp.reset(new ThreadPlanStepInRange(thread, range_of_curr_func, - sc, eOnlyThisThread, - eLazyBoolYes, eLazyBoolYes)); + ret_plan_sp = std::make_shared( + thread, range_of_curr_func, sc, eOnlyThisThread, eLazyBoolYes, + eLazyBoolYes); return ret_plan_sp; } } Index: lldb/source/Target/Memory.cpp =================================================================== --- lldb/source/Target/Memory.cpp +++ lldb/source/Target/Memory.cpp @@ -8,11 +8,13 @@ #include "lldb/Target/Memory.h" #include + #include "lldb/Core/RangeMap.h" #include "lldb/Target/Process.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/State.h" +#include using namespace lldb; using namespace lldb_private; @@ -357,8 +359,8 @@ } if (addr != LLDB_INVALID_ADDRESS) { - block_sp.reset( - new AllocatedBlock(addr, page_byte_size, permissions, chunk_size)); + block_sp = std::make_shared(addr, page_byte_size, + permissions, chunk_size); m_memory_map.insert(std::make_pair(permissions, block_sp)); } return block_sp; Index: lldb/source/Target/Platform.cpp =================================================================== --- lldb/source/Target/Platform.cpp +++ lldb/source/Target/Platform.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "llvm/Support/FileSystem.h" @@ -78,7 +79,7 @@ } PlatformProperties::PlatformProperties() { - m_collection_sp.reset(new OptionValueProperties(GetSettingName())); + m_collection_sp = std::make_shared(GetSettingName()); m_collection_sp->Initialize(g_properties); auto module_cache_dir = GetModuleCacheDirectory(); Index: lldb/source/Target/Process.cpp =================================================================== --- lldb/source/Target/Process.cpp +++ lldb/source/Target/Process.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include +#include #include #include "llvm/Support/ScopedPrinter.h" @@ -163,15 +164,15 @@ { if (process == nullptr) { // Global process properties, set them up one time - m_collection_sp.reset( - new ProcessOptionValueProperties(ConstString("process"))); + m_collection_sp = + std::make_shared(ConstString("process")); m_collection_sp->Initialize(g_properties); m_collection_sp->AppendProperty( ConstString("thread"), ConstString("Settings specific to threads."), true, Thread::GetGlobalProperties()->GetValueProperties()); } else { - m_collection_sp.reset( - new ProcessOptionValueProperties(Process::GetGlobalProperties().get())); + m_collection_sp = std::make_shared( + Process::GetGlobalProperties().get()); m_collection_sp->SetValueChangedCallback( ePropertyPythonOSPluginPath, ProcessProperties::OptionValueChangedCallback, this); @@ -4670,7 +4671,8 @@ // Now read thread is set up, set up input reader. if (!m_process_input_reader) - m_process_input_reader.reset(new IOHandlerProcessSTDIO(this, fd)); + m_process_input_reader = + std::make_shared(this, fd); } } } @@ -5944,7 +5946,8 @@ return threads; } - threads.reset(new ThreadCollection(memory_history->GetHistoryThreads(addr))); + threads = std::make_shared( + memory_history->GetHistoryThreads(addr)); return threads; } Index: lldb/source/Target/StackFrame.cpp =================================================================== --- lldb/source/Target/StackFrame.cpp +++ lldb/source/Target/StackFrame.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/StackFrame.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Disassembler.h" @@ -422,7 +424,7 @@ const bool get_child_variables = true; const bool can_create = true; const bool stop_if_child_block_is_inlined_function = true; - m_variable_list_sp.reset(new VariableList()); + m_variable_list_sp = std::make_shared(); frame_block->AppendBlockVariables(can_create, get_child_variables, stop_if_child_block_is_inlined_function, [](Variable *v) { return true; }, @@ -1173,7 +1175,7 @@ VariableList *var_list = GetVariableList(true); // If this frame has no variables, create a new list if (var_list == nullptr) - m_variable_list_sp.reset(new VariableList()); + m_variable_list_sp = std::make_shared(); // Add the global/static variable to this frame m_variable_list_sp->AddVariable(variable_sp); Index: lldb/source/Target/StackFrameList.cpp =================================================================== --- lldb/source/Target/StackFrameList.cpp +++ lldb/source/Target/StackFrameList.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/StackFrameList.h" #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointLocation.h" @@ -465,9 +467,9 @@ pc = reg_ctx_sp->GetPC(); } - unwind_frame_sp.reset(new StackFrame(m_thread.shared_from_this(), - m_frames.size(), idx, reg_ctx_sp, - cfa, pc, nullptr)); + unwind_frame_sp = std::make_shared( + m_thread.shared_from_this(), m_frames.size(), idx, reg_ctx_sp, + cfa, pc, nullptr); m_frames.push_back(unwind_frame_sp); } } else { @@ -483,9 +485,9 @@ break; } const bool cfa_is_valid = true; - unwind_frame_sp.reset( - new StackFrame(m_thread.shared_from_this(), m_frames.size(), idx, cfa, - cfa_is_valid, pc, StackFrame::Kind::Regular, nullptr)); + unwind_frame_sp = std::make_shared( + m_thread.shared_from_this(), m_frames.size(), idx, cfa, cfa_is_valid, + pc, StackFrame::Kind::Regular, nullptr); // Create synthetic tail call frames between the previous frame and the // newly-found frame. The new frame's index may change after this call, @@ -663,9 +665,9 @@ addr_t pc, cfa; if (unwinder->GetFrameInfoAtIndex(idx, cfa, pc)) { const bool cfa_is_valid = true; - frame_sp.reset(new StackFrame(m_thread.shared_from_this(), idx, idx, - cfa, cfa_is_valid, pc, - StackFrame::Kind::Regular, nullptr)); + frame_sp = std::make_shared( + m_thread.shared_from_this(), idx, idx, cfa, cfa_is_valid, pc, + StackFrame::Kind::Regular, nullptr); Function *function = frame_sp->GetSymbolContext(eSymbolContextFunction).function; Index: lldb/source/Target/Target.cpp =================================================================== --- lldb/source/Target/Target.cpp +++ lldb/source/Target/Target.cpp @@ -57,6 +57,7 @@ #include "lldb/Utility/State.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/Timer.h" +#include #include using namespace lldb; @@ -497,12 +498,13 @@ if (containingModule != nullptr) { // TODO: We should look into sharing module based search filters // across many breakpoints like we do for the simple target based one - filter_sp.reset( - new SearchFilterByModule(shared_from_this(), *containingModule)); + filter_sp = std::make_shared(shared_from_this(), + *containingModule); } else { if (!m_search_filter_sp) - m_search_filter_sp.reset( - new SearchFilterForUnconstrainedSearches(shared_from_this())); + m_search_filter_sp = + std::make_shared( + shared_from_this()); filter_sp = m_search_filter_sp; } return filter_sp; @@ -514,12 +516,13 @@ if (containingModules && containingModules->GetSize() != 0) { // TODO: We should look into sharing module based search filters // across many breakpoints like we do for the simple target based one - filter_sp.reset( - new SearchFilterByModuleList(shared_from_this(), *containingModules)); + filter_sp = std::make_shared(shared_from_this(), + *containingModules); } else { if (!m_search_filter_sp) - m_search_filter_sp.reset( - new SearchFilterForUnconstrainedSearches(shared_from_this())); + m_search_filter_sp = + std::make_shared( + shared_from_this()); filter_sp = m_search_filter_sp; } return filter_sp; @@ -536,11 +539,11 @@ // We could make a special "CU List only SearchFilter". Better yet was if // these could be composable, but that will take a little reworking. - filter_sp.reset(new SearchFilterByModuleListAndCU( - shared_from_this(), FileSpecList(), *containingSourceFiles)); + filter_sp = std::make_shared( + shared_from_this(), FileSpecList(), *containingSourceFiles); } else { - filter_sp.reset(new SearchFilterByModuleListAndCU( - shared_from_this(), *containingModules, *containingSourceFiles)); + filter_sp = std::make_shared( + shared_from_this(), *containingModules, *containingSourceFiles); } return filter_sp; } @@ -604,7 +607,8 @@ } else if (has_modules) { filter_sp = GetSearchFilterForModuleList(containingModules); } else { - filter_sp.reset(new SearchFilterForUnconstrainedSearches(shared_from_this())); + filter_sp = std::make_shared( + shared_from_this()); } StructuredDataImpl *extra_args_impl = new StructuredDataImpl(); @@ -847,7 +851,7 @@ } if (!wp_sp) { - wp_sp.reset(new Watchpoint(*this, addr, size, type)); + wp_sp = std::make_shared(*this, addr, size, type); wp_sp->SetWatchpointType(kind, notify); m_watchpoint_list.Add(wp_sp, true); } @@ -1024,7 +1028,7 @@ } if (!break_store_ptr) { - break_store_sp.reset(new StructuredData::Array()); + break_store_sp = std::make_shared(); break_store_ptr = break_store_sp.get(); } @@ -2290,7 +2294,7 @@ ClangASTImporterSP Target::GetClangASTImporter() { if (m_valid) { if (!m_ast_importer_sp) { - m_ast_importer_sp.reset(new ClangASTImporter()); + m_ast_importer_sp = std::make_shared(); } return m_ast_importer_sp; } @@ -3591,8 +3595,8 @@ TargetProperties::TargetProperties(Target *target) : Properties(), m_launch_info() { if (target) { - m_collection_sp.reset( - new TargetOptionValueProperties(target, Target::GetGlobalProperties())); + m_collection_sp = std::make_shared( + target, Target::GetGlobalProperties()); // Set callbacks to update launch_info whenever "settins set" updated any // of these properties @@ -3640,8 +3644,8 @@ DisableASLRValueChangedCallback(this, nullptr); DisableSTDIOValueChangedCallback(this, nullptr); } else { - m_collection_sp.reset( - new TargetOptionValueProperties(ConstString("target"))); + m_collection_sp = + std::make_shared(ConstString("target")); m_collection_sp->Initialize(g_properties); m_experimental_properties_up.reset(new TargetExperimentalProperties()); m_collection_sp->AppendProperty( Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/Thread.h" #include "Plugins/Process/Utility/UnwindLLDB.h" #include "Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h" @@ -121,12 +123,12 @@ ThreadProperties::ThreadProperties(bool is_global) : Properties() { if (is_global) { - m_collection_sp.reset( - new ThreadOptionValueProperties(ConstString("thread"))); + m_collection_sp = + std::make_shared(ConstString("thread")); m_collection_sp->Initialize(g_properties); } else - m_collection_sp.reset( - new ThreadOptionValueProperties(Thread::GetGlobalProperties().get())); + m_collection_sp = std::make_shared( + Thread::GetGlobalProperties().get()); } ThreadProperties::~ThreadProperties() = default; @@ -1383,9 +1385,9 @@ const SymbolContext &addr_context, lldb::RunMode stop_other_threads, Status &status, LazyBool step_out_avoids_code_withoug_debug_info) { ThreadPlanSP thread_plan_sp; - thread_plan_sp.reset(new ThreadPlanStepOverRange( + thread_plan_sp = std::make_shared( *this, range, addr_context, stop_other_threads, - step_out_avoids_code_withoug_debug_info)); + step_out_avoids_code_withoug_debug_info); status = QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; @@ -1603,7 +1605,8 @@ if (m_curr_frames_sp) { frame_list_sp = m_curr_frames_sp; } else { - frame_list_sp.reset(new StackFrameList(*this, m_prev_frames_sp, true)); + frame_list_sp = + std::make_shared(*this, m_prev_frames_sp, true); m_curr_frames_sp = frame_list_sp; } return frame_list_sp; Index: lldb/source/Target/ThreadPlanCallFunction.cpp =================================================================== --- lldb/source/Target/ThreadPlanCallFunction.cpp +++ lldb/source/Target/ThreadPlanCallFunction.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/ThreadPlanCallFunction.h" #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointLocation.h" @@ -404,8 +406,8 @@ GetThread().SetStopInfoToNothing(); #ifndef SINGLE_STEP_EXPRESSIONS - m_subplan_sp.reset( - new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads)); + m_subplan_sp = std::make_shared( + m_thread, m_start_addr, m_stop_other_threads); m_thread.QueueThreadPlan(m_subplan_sp, false); m_subplan_sp->SetPrivate(true); Index: lldb/source/Target/ThreadPlanStepOut.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepOut.cpp +++ lldb/source/Target/ThreadPlanStepOut.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Value.h" @@ -84,9 +86,9 @@ if (frame_idx > 0) { // First queue a plan that gets us to this inlined frame, and when we get // there we'll queue a second plan that walks us out of this frame. - m_step_out_to_inline_plan_sp.reset(new ThreadPlanStepOut( + m_step_out_to_inline_plan_sp = std::make_shared( m_thread, nullptr, false, stop_others, eVoteNoOpinion, eVoteNoOpinion, - frame_idx - 1, eLazyBoolNo, continue_to_next_branch)); + frame_idx - 1, eLazyBoolNo, continue_to_next_branch); static_cast(m_step_out_to_inline_plan_sp.get()) ->SetShouldStopHereCallbacks(nullptr, nullptr); m_step_out_to_inline_plan_sp->SetPrivate(true); @@ -449,8 +451,9 @@ m_stop_others ? lldb::eOnlyThisThread : lldb::eAllThreads; const LazyBool avoid_no_debug = eLazyBoolNo; - m_step_through_inline_plan_sp.reset(new ThreadPlanStepOverRange( - m_thread, inline_range, inlined_sc, run_mode, avoid_no_debug)); + m_step_through_inline_plan_sp = + std::make_shared( + m_thread, inline_range, inlined_sc, run_mode, avoid_no_debug); ThreadPlanStepOverRange *step_through_inline_plan_ptr = static_cast( m_step_through_inline_plan_sp.get()); Index: lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp =================================================================== --- lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp +++ lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -229,7 +230,7 @@ "missing from configuration."); return false; } - m_filter_chain_sp.reset(new LogFilterChain(filter_default_accept)); + m_filter_chain_sp = std::make_shared(filter_default_accept); DNBLogThreadedIf(LOG_DARWIN_LOG, "DarwinLog no-match rule: %s.", filter_default_accept ? "accept" : "reject"); @@ -315,8 +316,8 @@ } // Create the filter. - filter_sp.reset( - new LogFilterExactMatch(filter_accepts, target_enum, exact_text)); + filter_sp = std::make_shared( + filter_accepts, target_enum, exact_text); } // Add the filter to the chain. Index: lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp =================================================================== --- lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp +++ lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp @@ -15,6 +15,8 @@ #include #include +#include + #include "DNBLog.h" #include "DNBThreadResumeActions.h" #include "MachProcess.h" @@ -310,8 +312,8 @@ currThreads.push_back(thread_sp); } else { // We don't have this thread, lets add it. - thread_sp.reset(new MachThread(process, m_is_64_bit, unique_thread_id, - mach_port_num)); + thread_sp = std::make_shared( + process, m_is_64_bit, unique_thread_id, mach_port_num); // Add the new thread regardless of its is user ready state... // Make sure the thread is ready to be displayed and shown to users Index: lldb/tools/debugserver/source/RNBRemote.cpp =================================================================== --- lldb/tools/debugserver/source/RNBRemote.cpp +++ lldb/tools/debugserver/source/RNBRemote.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -5227,7 +5228,7 @@ RNBRemote::GetJSONThreadsInfo(bool threads_with_valid_stop_info_only) { JSONGenerator::ArraySP threads_array_sp; if (m_ctx.HasValidProcessID()) { - threads_array_sp.reset(new JSONGenerator::Array()); + threads_array_sp = std::make_shared(); nub_process_t pid = m_ctx.ProcessID(); Index: lldb/tools/debugserver/source/debugserver.cpp =================================================================== --- lldb/tools/debugserver/source/debugserver.cpp +++ lldb/tools/debugserver/source/debugserver.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -937,7 +938,7 @@ sigaddset(&sigset, SIGCHLD); sigprocmask(SIG_BLOCK, &sigset, NULL); - g_remoteSP.reset(new RNBRemote()); + g_remoteSP = std::make_shared(); RNBRemote *remote = g_remoteSP.get(); if (remote == NULL) { Index: lldb/tools/debugserver/source/libdebugserver.cpp =================================================================== --- lldb/tools/debugserver/source/libdebugserver.cpp +++ lldb/tools/debugserver/source/libdebugserver.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include "DNB.h" #include "DNBLog.h" #include "DNBTimer.h" @@ -338,7 +340,7 @@ signal(SIGPIPE, signal_handler); - g_remoteSP.reset(new RNBRemote); + g_remoteSP = std::make_shared(); RNBRemote *remote = g_remoteSP.get(); if (remote == NULL) { Index: lldb/unittests/Editline/EditlineTest.cpp =================================================================== --- lldb/unittests/Editline/EditlineTest.cpp +++ lldb/unittests/Editline/EditlineTest.cpp @@ -257,8 +257,8 @@ return; // Dump output. - _sp_output_thread.reset( - new std::thread([&] { _el_adapter.ConsumeAllOutput(); })); + _sp_output_thread = + std::make_shared([&] { _el_adapter.ConsumeAllOutput(); }); } void TearDown() { Index: lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp =================================================================== --- lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp +++ lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp @@ -10,6 +10,7 @@ #include "gtest/gtest.h" +#include #include #include "Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h" @@ -2225,7 +2226,7 @@ unwind_plan.SetPlanValidAddressRange(sample_range); unwind_plan.SetRegisterKind(eRegisterKindLLDB); - row_sp.reset(new UnwindPlan::Row); + row_sp = std::make_shared(); // Describe offset 0 row_sp->SetOffset(0); @@ -2303,7 +2304,7 @@ unwind_plan.SetPlanValidAddressRange(sample_range); unwind_plan.SetRegisterKind(eRegisterKindLLDB); - row_sp.reset(new UnwindPlan::Row); + row_sp = std::make_shared(); // Describe offset 0 row_sp->SetOffset(0);