From a8f3ae7c9cefa8296d119f92ca444087cdccf712 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 14 Aug 2019 22:19:23 +0000 Subject: [PATCH] [LLDB] Migrate llvm::make_unique to std::make_unique Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368933 --- lldb/include/lldb/Utility/Reproducer.h | 2 +- lldb/include/lldb/Utility/ReproducerInstrumentation.h | 4 ++-- lldb/source/API/SBAddress.cpp | 2 +- lldb/source/API/SBBreakpointOptionCommon.cpp | 2 +- lldb/source/API/SBDebugger.cpp | 16 ++++++++-------- lldb/source/API/SBDeclaration.cpp | 2 +- lldb/source/API/SBFrame.cpp | 2 +- lldb/source/API/SBLineEntry.cpp | 4 ++-- lldb/source/API/SBStringList.cpp | 2 +- lldb/source/API/SBSymbolContext.cpp | 4 ++-- lldb/source/API/SBTarget.cpp | 2 +- lldb/source/API/Utils.h | 2 +- lldb/source/Breakpoint/BreakpointOptions.cpp | 2 +- lldb/source/Commands/CommandObjectBreakpoint.cpp | 2 +- lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 4 ++-- lldb/source/Commands/CommandObjectCommands.cpp | 2 +- lldb/source/Core/Debugger.cpp | 6 +++--- lldb/source/Core/Module.cpp | 4 ++-- lldb/source/Core/ValueObjectSyntheticFilter.cpp | 2 +- lldb/source/Expression/IRExecutionUnit.cpp | 2 +- lldb/source/Host/common/Socket.cpp | 8 ++++---- .../DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 4 ++-- .../Plugins/ExpressionParser/Clang/ClangASTSource.cpp | 2 +- .../ExpressionParser/Clang/ClangExpressionDeclMap.h | 2 +- lldb/source/Plugins/Language/ObjC/NSDictionary.h | 4 ++-- .../Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp | 2 +- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 2 +- .../source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 2 +- .../Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 6 +++--- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 2 +- .../Process/Linux/NativeRegisterContextLinux_arm.cpp | 2 +- .../Process/Linux/NativeRegisterContextLinux_arm64.cpp | 4 ++-- .../Process/Linux/NativeRegisterContextLinux_mips64.cpp | 2 +- .../Process/Linux/NativeRegisterContextLinux_ppc64le.cpp | 2 +- .../Process/Linux/NativeRegisterContextLinux_s390x.cpp | 2 +- lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp | 2 +- .../Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | 2 +- lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp | 2 +- .../Process/Windows/Common/NativeProcessWindows.cpp | 4 ++-- .../Windows/Common/NativeRegisterContextWindows_i386.cpp | 2 +- .../Common/NativeRegisterContextWindows_x86_64.cpp | 4 ++-- .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 2 +- lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp | 6 +++--- .../ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 8 ++++---- .../Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp | 10 +++++----- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp | 2 +- .../Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 10 +++++----- .../Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp | 4 ++-- .../Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 8 ++++---- lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 2 +- lldb/source/Symbol/ClangASTContext.cpp | 2 +- lldb/source/Target/Platform.cpp | 2 +- lldb/source/Utility/Reproducer.cpp | 4 ++-- lldb/source/Utility/StructuredData.cpp | 4 ++-- lldb/tools/lldb-instr/Instrument.cpp | 6 +++--- lldb/tools/lldb-server/lldb-server.cpp | 2 +- lldb/tools/lldb-test/lldb-test.cpp | 2 +- lldb/unittests/Host/MainLoopTest.cpp | 2 +- .../Process/minidump/RegisterContextMinidumpTest.cpp | 4 ++-- .../unittests/tools/lldb-server/tests/MessageObjects.cpp | 4 ++-- lldb/unittests/tools/lldb-server/tests/TestClient.cpp | 2 +- 63 files changed, 110 insertions(+), 110 deletions(-) diff --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h index 27a3cce..c320d00 100644 --- a/lldb/include/lldb/Utility/Reproducer.h +++ b/lldb/include/lldb/Utility/Reproducer.h @@ -203,7 +203,7 @@ public: /// Create and register a new provider. template T *Create() { - std::unique_ptr provider = llvm::make_unique(m_root); + std::unique_ptr provider = std::make_unique(m_root); return static_cast(Register(std::move(provider))); } diff --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h b/lldb/include/lldb/Utility/ReproducerInstrumentation.h index f90ce4b..9be632e 100644 --- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h +++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h @@ -442,7 +442,7 @@ public: void Register(Signature *f, llvm::StringRef result = {}, llvm::StringRef scope = {}, llvm::StringRef name = {}, llvm::StringRef args = {}) { - DoRegister(uintptr_t(f), llvm::make_unique>(f), + DoRegister(uintptr_t(f), std::make_unique>(f), SignatureStr(result, scope, name, args)); } @@ -452,7 +452,7 @@ public: void Register(Signature *f, Signature *g, llvm::StringRef result = {}, llvm::StringRef scope = {}, llvm::StringRef name = {}, llvm::StringRef args = {}) { - DoRegister(uintptr_t(f), llvm::make_unique>(g), + DoRegister(uintptr_t(f), std::make_unique>(g), SignatureStr(result, scope, name, args)); } diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index 358cb40..08095b5 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -28,7 +28,7 @@ SBAddress::SBAddress() : m_opaque_up(new Address()) { SBAddress::SBAddress(const Address *lldb_object_ptr) : m_opaque_up(new Address()) { if (lldb_object_ptr) - m_opaque_up = llvm::make_unique
(*lldb_object_ptr); + m_opaque_up = std::make_unique
(*lldb_object_ptr); } SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_up(new Address()) { diff --git a/lldb/source/API/SBBreakpointOptionCommon.cpp b/lldb/source/API/SBBreakpointOptionCommon.cpp index 058b3e0..870b4b9 100644 --- a/lldb/source/API/SBBreakpointOptionCommon.cpp +++ b/lldb/source/API/SBBreakpointOptionCommon.cpp @@ -41,7 +41,7 @@ using namespace lldb_private; SBBreakpointCallbackBaton::SBBreakpointCallbackBaton(SBBreakpointHitCallback callback, void *baton) - : TypedBaton(llvm::make_unique()) { + : TypedBaton(std::make_unique()) { getItem()->callback = callback; getItem()->callback_baton = baton; } diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index b35c125..f5da467 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -88,7 +88,7 @@ public: file = absolute_path.GetPath(); } - return llvm::make_unique(std::move(files)); + return std::make_unique(std::move(files)); } FILE *GetNextFile() { @@ -204,7 +204,7 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() { SBError error; if (auto e = g_debugger_lifetime->Initialize( - llvm::make_unique(), LoadPlugin)) { + std::make_unique(), LoadPlugin)) { error.SetError(Status(std::move(e))); } return LLDB_RECORD_RESULT(error); @@ -599,18 +599,18 @@ const char *SBDebugger::StateAsCString(StateType state) { static void AddBoolConfigEntry(StructuredData::Dictionary &dict, llvm::StringRef name, bool value, llvm::StringRef description) { - auto entry_up = llvm::make_unique(); + auto entry_up = std::make_unique(); entry_up->AddBooleanItem("value", value); entry_up->AddStringItem("description", description); dict.AddItem(name, std::move(entry_up)); } static void AddLLVMTargets(StructuredData::Dictionary &dict) { - auto array_up = llvm::make_unique(); + auto array_up = std::make_unique(); #define LLVM_TARGET(target) \ - array_up->AddItem(llvm::make_unique(#target)); + array_up->AddItem(std::make_unique(#target)); #include "llvm/Config/Targets.def" - auto entry_up = llvm::make_unique(); + auto entry_up = std::make_unique(); entry_up->AddItem("value", std::move(array_up)); entry_up->AddStringItem("description", "A list of configured LLVM targets."); dict.AddItem("targets", std::move(entry_up)); @@ -620,7 +620,7 @@ SBStructuredData SBDebugger::GetBuildConfiguration() { LLDB_RECORD_STATIC_METHOD_NO_ARGS(lldb::SBStructuredData, SBDebugger, GetBuildConfiguration); - auto config_up = llvm::make_unique(); + auto config_up = std::make_unique(); AddBoolConfigEntry( *config_up, "xml", XMLDocument::XMLEnabled(), "A boolean value that indicates if XML support is enabled in LLDB"); @@ -1012,7 +1012,7 @@ SBStructuredData SBDebugger::GetAvailablePlatformInfoAtIndex(uint32_t idx) { GetAvailablePlatformInfoAtIndex, (uint32_t), idx); SBStructuredData data; - auto platform_dict = llvm::make_unique(); + auto platform_dict = std::make_unique(); llvm::StringRef name_str("name"), desc_str("description"); if (idx == 0) { diff --git a/lldb/source/API/SBDeclaration.cpp b/lldb/source/API/SBDeclaration.cpp index a7790b2..50db177 100644 --- a/lldb/source/API/SBDeclaration.cpp +++ b/lldb/source/API/SBDeclaration.cpp @@ -32,7 +32,7 @@ SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_up() { SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr) : m_opaque_up() { if (lldb_object_ptr) - m_opaque_up = llvm::make_unique(*lldb_object_ptr); + m_opaque_up = std::make_unique(*lldb_object_ptr); } const SBDeclaration &SBDeclaration::operator=(const SBDeclaration &rhs) { diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 078d8bf..c0e272e 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -1107,7 +1107,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr, if (target->GetDisplayExpressionsInCrashlogs()) { StreamString frame_description; frame->DumpUsingSettingsFormat(&frame_description); - stack_trace = llvm::make_unique( + stack_trace = std::make_unique( "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value " "= %u) %s", expr, options.GetFetchDynamicValue(), diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp index 010a605..66884f76 100644 --- a/lldb/source/API/SBLineEntry.cpp +++ b/lldb/source/API/SBLineEntry.cpp @@ -32,7 +32,7 @@ SBLineEntry::SBLineEntry(const SBLineEntry &rhs) : m_opaque_up() { SBLineEntry::SBLineEntry(const lldb_private::LineEntry *lldb_object_ptr) : m_opaque_up() { if (lldb_object_ptr) - m_opaque_up = llvm::make_unique(*lldb_object_ptr); + m_opaque_up = std::make_unique(*lldb_object_ptr); } const SBLineEntry &SBLineEntry::operator=(const SBLineEntry &rhs) { @@ -45,7 +45,7 @@ const SBLineEntry &SBLineEntry::operator=(const SBLineEntry &rhs) { } void SBLineEntry::SetLineEntry(const lldb_private::LineEntry &lldb_object_ref) { - m_opaque_up = llvm::make_unique(lldb_object_ref); + m_opaque_up = std::make_unique(lldb_object_ref); } SBLineEntry::~SBLineEntry() {} diff --git a/lldb/source/API/SBStringList.cpp b/lldb/source/API/SBStringList.cpp index 2f8bd55..ac07b8f 100644 --- a/lldb/source/API/SBStringList.cpp +++ b/lldb/source/API/SBStringList.cpp @@ -21,7 +21,7 @@ SBStringList::SBStringList() : m_opaque_up() { SBStringList::SBStringList(const lldb_private::StringList *lldb_strings_ptr) : m_opaque_up() { if (lldb_strings_ptr) - m_opaque_up = llvm::make_unique(*lldb_strings_ptr); + m_opaque_up = std::make_unique(*lldb_strings_ptr); } SBStringList::SBStringList(const SBStringList &rhs) : m_opaque_up() { diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp index 365f0cc..6e01e55 100644 --- a/lldb/source/API/SBSymbolContext.cpp +++ b/lldb/source/API/SBSymbolContext.cpp @@ -27,7 +27,7 @@ SBSymbolContext::SBSymbolContext(const SymbolContext *sc_ptr) : m_opaque_up() { (const lldb_private::SymbolContext *), sc_ptr); if (sc_ptr) - m_opaque_up = llvm::make_unique(*sc_ptr); + m_opaque_up = std::make_unique(*sc_ptr); } SBSymbolContext::SBSymbolContext(const SBSymbolContext &rhs) : m_opaque_up() { @@ -51,7 +51,7 @@ const SBSymbolContext &SBSymbolContext::operator=(const SBSymbolContext &rhs) { void SBSymbolContext::SetSymbolContext(const SymbolContext *sc_ptr) { if (sc_ptr) - m_opaque_up = llvm::make_unique(*sc_ptr); + m_opaque_up = std::make_unique(*sc_ptr); else m_opaque_up->Clear(true); } diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index d91def0..a1faa8a 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -218,7 +218,7 @@ SBStructuredData SBTarget::GetStatistics() { if (!target_sp) return LLDB_RECORD_RESULT(data); - auto stats_up = llvm::make_unique(); + auto stats_up = std::make_unique(); int i = 0; for (auto &Entry : target_sp->GetStatistics()) { std::string Desc = lldb_private::GetStatDescription( diff --git a/lldb/source/API/Utils.h b/lldb/source/API/Utils.h index b1975e5..ed81534 100644 --- a/lldb/source/API/Utils.h +++ b/lldb/source/API/Utils.h @@ -16,7 +16,7 @@ namespace lldb_private { template std::unique_ptr clone(const std::unique_ptr &src) { if (src) - return llvm::make_unique(*src); + return std::make_unique(*src); return nullptr; } diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index f6f279d..0d4c617 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -309,7 +309,7 @@ std::unique_ptr BreakpointOptions::CreateFromStructuredData( } } - auto bp_options = llvm::make_unique( + auto bp_options = std::make_unique( condition_ref.str().c_str(), enabled, ignore_count, one_shot, auto_continue); if (cmd_data_up) { diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index d23c969..96e38ed 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -159,7 +159,7 @@ public: { if (!m_commands.empty()) { - auto cmd_data = llvm::make_unique(); + auto cmd_data = std::make_unique(); for (std::string &str : m_commands) cmd_data->user_source.AppendString(str); diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index cba0392..81d449d 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -238,7 +238,7 @@ are no syntax errors may indicate that a function was declared but never called. if (!bp_options) continue; - auto cmd_data = llvm::make_unique(); + auto cmd_data = std::make_unique(); cmd_data->user_source.SplitIntoLines(line.c_str(), line.size()); bp_options->SetCommandDataCallback(cmd_data); } @@ -260,7 +260,7 @@ are no syntax errors may indicate that a function was declared but never called. SetBreakpointCommandCallback(std::vector &bp_options_vec, const char *oneliner) { for (auto bp_options : bp_options_vec) { - auto cmd_data = llvm::make_unique(); + auto cmd_data = std::make_unique(); cmd_data->user_source.AppendString(oneliner); cmd_data->stop_on_error = m_options.m_stop_on_error; diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 3d2568f..e7f99e2 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -997,7 +997,7 @@ protected: Status error; auto name = command[0].ref; - m_regex_cmd_up = llvm::make_unique( + m_regex_cmd_up = std::make_unique( m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 10, 0, true); diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index a7c8f65..673de95 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -275,7 +275,7 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx, if (str.length()) new_prompt = str; GetCommandInterpreter().UpdatePrompt(new_prompt); - auto bytes = llvm::make_unique(new_prompt); + auto bytes = std::make_unique(new_prompt); auto prompt_change_event_sp = std::make_shared( CommandInterpreter::eBroadcastBitResetPrompt, bytes.release()); GetCommandInterpreter().BroadcastEvent(prompt_change_event_sp); @@ -704,7 +704,7 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton) m_listener_sp(Listener::MakeListener("lldb.Debugger")), m_source_manager_up(), m_source_file_cache(), m_command_interpreter_up( - llvm::make_unique(*this, false)), + std::make_unique(*this, false)), m_script_interpreter_sp(), m_input_reader_stack(), m_instance_name(), m_loaded_plugins(), m_event_handler_thread(), m_io_handler_thread(), m_sync_broadcaster(nullptr, "lldb.debugger.sync"), @@ -1239,7 +1239,7 @@ ScriptInterpreter *Debugger::GetScriptInterpreter(bool can_create) { SourceManager &Debugger::GetSourceManager() { if (!m_source_manager_up) - m_source_manager_up = llvm::make_unique(shared_from_this()); + m_source_manager_up = std::make_unique(shared_from_this()); return *m_source_manager_up; } diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 3f21ef8..82d2f20 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -292,7 +292,7 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp, std::lock_guard guard(m_mutex); if (process_sp) { m_did_load_objfile = true; - auto data_up = llvm::make_unique(size_to_read, 0); + auto data_up = std::make_unique(size_to_read, 0); Status readmem_error; const size_t bytes_read = process_sp->ReadMemory(header_addr, data_up->GetBytes(), @@ -1297,7 +1297,7 @@ UnwindTable &Module::GetUnwindTable() { SectionList *Module::GetUnifiedSectionList() { if (!m_sections_up) - m_sections_up = llvm::make_unique(); + m_sections_up = std::make_unique(); return m_sections_up.get(); } diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp index 450dedd..a6bf35e 100644 --- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp +++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp @@ -140,7 +140,7 @@ void ValueObjectSynthetic::CreateSynthFilter() { } m_synth_filter_up = (m_synth_sp->GetFrontEnd(*valobj_for_frontend)); if (!m_synth_filter_up) - m_synth_filter_up = llvm::make_unique(*m_parent); + m_synth_filter_up = std::make_unique(*m_parent); } bool ValueObjectSynthetic::UpdateValue() { diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index 14d09af..cbcea13 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -316,7 +316,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr, }; if (process_sp->GetTarget().GetEnableSaveObjects()) { - m_object_cache_up = llvm::make_unique(); + m_object_cache_up = std::make_unique(); m_execution_engine_up->setObjectCache(m_object_cache_up.get()); } diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp index ea1049d..0732565 100644 --- a/lldb/source/Host/common/Socket.cpp +++ b/lldb/source/Host/common/Socket.cpp @@ -114,16 +114,16 @@ std::unique_ptr Socket::Create(const SocketProtocol protocol, switch (protocol) { case ProtocolTcp: socket_up = - llvm::make_unique(true, child_processes_inherit); + std::make_unique(true, child_processes_inherit); break; case ProtocolUdp: socket_up = - llvm::make_unique(true, child_processes_inherit); + std::make_unique(true, child_processes_inherit); break; case ProtocolUnixDomain: #ifndef LLDB_DISABLE_POSIX socket_up = - llvm::make_unique(true, child_processes_inherit); + std::make_unique(true, child_processes_inherit); #else error.SetErrorString( "Unix domain sockets are not supported on this platform."); @@ -132,7 +132,7 @@ std::unique_ptr Socket::Create(const SocketProtocol protocol, case ProtocolUnixAbstract: #ifdef __linux__ socket_up = - llvm::make_unique(child_processes_inherit); + std::make_unique(child_processes_inherit); #else error.SetErrorString( "Abstract domain sockets are not supported on this platform."); diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index da8ba29..9d61c8f 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -87,7 +87,7 @@ void DynamicLoaderPOSIXDYLD::DidAttach() { Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s() pid %" PRIu64, __FUNCTION__, m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID); - m_auxv = llvm::make_unique(m_process->GetAuxvData()); + m_auxv = std::make_unique(m_process->GetAuxvData()); LLDB_LOGF( log, "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64 " reloaded auxv data", @@ -179,7 +179,7 @@ void DynamicLoaderPOSIXDYLD::DidLaunch() { ModuleSP executable; addr_t load_offset; - m_auxv = llvm::make_unique(m_process->GetAuxvData()); + m_auxv = std::make_unique(m_process->GetAuxvData()); executable = GetTargetExecutable(); load_offset = ComputeLoadOffset(); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index b199a5a..d25b435 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -135,7 +135,7 @@ void ClangASTSource::InstallASTContext(clang::ASTContext &ast_context, ; m_merger_up = - llvm::make_unique(target, sources); + std::make_unique(target, sources); } else { m_ast_importer_sp->InstallMapCompleter(&ast_context, *this); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 03b73e6..2711e90 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -356,7 +356,7 @@ private: /// Activate parser-specific variables void EnableParserVars() { if (!m_parser_vars.get()) - m_parser_vars = llvm::make_unique(); + m_parser_vars = std::make_unique(); } /// Deallocate parser-specific variables diff --git a/lldb/source/Plugins/Language/ObjC/NSDictionary.h b/lldb/source/Plugins/Language/ObjC/NSDictionary.h index ecb3fcc..44d56f9 100644 --- a/lldb/source/Plugins/Language/ObjC/NSDictionary.h +++ b/lldb/source/Plugins/Language/ObjC/NSDictionary.h @@ -68,10 +68,10 @@ public: }; typedef Matcher::UP MatcherUP; - MatcherUP GetFullMatch(ConstString n) { return llvm::make_unique(n); } + MatcherUP GetFullMatch(ConstString n) { return std::make_unique(n); } MatcherUP GetPrefixMatch(ConstString p) { - return llvm::make_unique(p); + return std::make_unique(p); } }; diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp index f895e9c..3b9e0e2 100644 --- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp +++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp @@ -127,7 +127,7 @@ Symtab *ObjectFileBreakpad::GetSymtab() { void ObjectFileBreakpad::CreateSections(SectionList &unified_section_list) { if (m_sections_up) return; - m_sections_up = llvm::make_unique(); + m_sections_up = std::make_unique(); llvm::Optional current_section; offset_t section_start; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 6cdf401..e507f0e 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1762,7 +1762,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { if (m_sections_up) return; - m_sections_up = llvm::make_unique(); + m_sections_up = std::make_unique(); VMAddressProvider regular_provider(GetType(), "PT_LOAD"); VMAddressProvider tls_provider(GetType(), "PT_TLS"); diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index bfb732b..d3027eb 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -874,7 +874,7 @@ ObjectFile *ObjectFileMachO::CreateInstance(const lldb::ModuleSP &module_sp, return nullptr; data_offset = 0; } - auto objfile_up = llvm::make_unique( + auto objfile_up = std::make_unique( module_sp, data_sp, data_offset, file, file_offset, length); if (!objfile_up || !objfile_up->ParseHeader()) return nullptr; diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index d2dd934..0328931 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -133,7 +133,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp, return nullptr; } - auto objfile_up = llvm::make_unique( + auto objfile_up = std::make_unique( module_sp, data_sp, data_offset, file, file_offset, length); if (!objfile_up || !objfile_up->ParseHeader()) return nullptr; @@ -150,7 +150,7 @@ ObjectFile *ObjectFilePECOFF::CreateMemoryInstance( const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) { if (!data_sp || !ObjectFilePECOFF::MagicBytesMatch(data_sp)) return nullptr; - auto objfile_up = llvm::make_unique( + auto objfile_up = std::make_unique( module_sp, data_sp, process_sp, header_addr); if (objfile_up.get() && objfile_up->ParseHeader()) { return objfile_up.release(); @@ -524,7 +524,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) { ProcessSP process_sp(m_process_wp.lock()); DataExtractor data; if (process_sp) { - auto data_up = llvm::make_unique(size, 0); + auto data_up = std::make_unique(size, 0); Status readmem_error; size_t bytes_read = process_sp->ReadMemory(m_image_base + offset, data_up->GetBytes(), diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index c1da6f3..32be0ca 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1591,7 +1591,7 @@ NativeThreadLinux &NativeProcessLinux::AddThread(lldb::tid_t thread_id) { if (m_threads.empty()) SetCurrentThreadID(thread_id); - m_threads.push_back(llvm::make_unique(*this, thread_id)); + m_threads.push_back(std::make_unique(*this, thread_id)); if (m_pt_proces_trace_id != LLDB_INVALID_UID) { auto traceMonitor = ProcessorTraceMonitor::Create( diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp index 27eaefd..8f87432 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp @@ -97,7 +97,7 @@ static const RegisterSet g_reg_sets_arm[k_num_register_sets] = { std::unique_ptr NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp index e65b768..a1dbf8d 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -112,10 +112,10 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { switch (target_arch.GetMachine()) { case llvm::Triple::arm: - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); case llvm::Triple::aarch64: - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); default: llvm_unreachable("have no register context for architecture"); diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 6e4fe59..d456cbb 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -79,7 +79,7 @@ using namespace lldb_private::process_linux; std::unique_ptr NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp index 11cf1a2..310ba0e 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp @@ -118,7 +118,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { switch (target_arch.GetMachine()) { case llvm::Triple::ppc64le: - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); default: llvm_unreachable("have no register context for architecture"); diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp index b44bb93..2ee8779 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -95,7 +95,7 @@ static const RegisterSet g_reg_sets_s390x[k_num_register_sets] = { std::unique_ptr NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp index a7837da..a3b89c5 100644 --- a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -172,7 +172,7 @@ std::unique_ptr SingleStepWorkaround::Get(::pid_t tid) { } LLDB_LOG(log, "workaround for thread {0} prepared", tid); - return llvm::make_unique(tid, original_set); + return std::make_unique(tid, original_set); } SingleStepWorkaround::~SingleStepWorkaround() { diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index edadfa3..87feca3 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -659,7 +659,7 @@ NativeThreadNetBSD &NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) { if (m_threads.empty()) SetCurrentThreadID(thread_id); - m_threads.push_back(llvm::make_unique(*this, thread_id)); + m_threads.push_back(std::make_unique(*this, thread_id)); return static_cast(*m_threads.back()); } diff --git a/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp b/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp index 6470eca..058dc5a 100644 --- a/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp +++ b/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp @@ -21,7 +21,7 @@ NativeProcessELF::GetAuxValue(enum AuxVector::EntryType type) { DataExtractor auxv_data(buffer_or_error.get()->getBufferStart(), buffer_or_error.get()->getBufferSize(), GetByteOrder(), GetAddressByteSize()); - m_aux_vector = llvm::make_unique(auxv_data); + m_aux_vector = std::make_unique(auxv_data); } return m_aux_vector->GetAuxValue(type); diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp index d077954..2283b53 100644 --- a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp @@ -410,7 +410,7 @@ void NativeProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) { // The very first one shall always be the main thread. assert(m_threads.empty()); - m_threads.push_back(llvm::make_unique( + m_threads.push_back(std::make_unique( *this, m_session_data->m_debugger->GetMainThread())); } @@ -514,7 +514,7 @@ NativeProcessWindows::OnDebugException(bool first_chance, void NativeProcessWindows::OnCreateThread(const HostThread &new_thread) { llvm::sys::ScopedLock lock(m_mutex); m_threads.push_back( - llvm::make_unique(*this, new_thread)); + std::make_unique(*this, new_thread)); } void NativeProcessWindows::OnExitThread(lldb::tid_t thread_id, diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp index c47995c..3de1470 100644 --- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp @@ -86,7 +86,7 @@ static Status SetThreadContextHelper(lldb::thread_t thread_handle, std::unique_ptr NativeRegisterContextWindows::CreateHostNativeRegisterContextWindows( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp index 41003cc..95e8ce1 100644 --- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp @@ -100,11 +100,11 @@ NativeRegisterContextWindows::CreateHostNativeRegisterContextWindows( const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { // Register context for a WoW64 application. if (target_arch.GetAddressByteSize() == 4) - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); // Register context for a native 64-bit application. - return llvm::make_unique(target_arch, + return std::make_unique(target_arch, native_thread); } diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 3c1c66d..098e833 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -179,7 +179,7 @@ public: FileSpec history_file = GetRoot().CopyByAppendingPathComponent(Info::file); std::error_code EC; - m_stream_up = llvm::make_unique( + m_stream_up = std::make_unique( history_file.GetPath(), EC, sys::fs::OpenFlags::OF_Text); return m_stream_up.get(); } diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp index a7fc42ca..41dc08b 100644 --- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp +++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp @@ -55,7 +55,7 @@ public: /*length*/ 0, /*data_sp*/ nullptr, /*data_offset*/ 0), m_arch(module_spec.GetArchitecture()), m_uuid(module_spec.GetUUID()), m_base(base), m_size(size) { - m_symtab_up = llvm::make_unique(this); + m_symtab_up = std::make_unique(this); } ConstString GetPluginName() override { return ConstString("placeholder"); } @@ -80,7 +80,7 @@ public: } void CreateSections(SectionList &unified_section_list) override { - m_sections_up = llvm::make_unique(); + m_sections_up = std::make_unique(); auto section_sp = std::make_shared
( GetModule(), this, /*sect_id*/ 0, ConstString(".module_image"), eSectionTypeOther, m_base, m_size, /*file_offset*/ 0, /*file_size*/ 0, @@ -444,7 +444,7 @@ bool ProcessMinidump::GetProcessInfo(ProcessInstanceInfo &info) { // debug information than needed. JITLoaderList &ProcessMinidump::GetJITLoaders() { if (!m_jit_loaders_up) { - m_jit_loaders_up = llvm::make_unique(); + m_jit_loaders_up = std::make_unique(); } return *m_jit_loaders_up; } diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 82b5d5f..7fe3157 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -558,7 +558,7 @@ void ScriptInterpreterPythonImpl::IOHandlerInputComplete(IOHandler &io_handler, if (!bp_options) continue; - auto data_up = llvm::make_unique(); + auto data_up = std::make_unique(); if (!data_up) break; data_up->user_source.SplitIntoLines(data); @@ -583,7 +583,7 @@ void ScriptInterpreterPythonImpl::IOHandlerInputComplete(IOHandler &io_handler, case eIOHandlerWatchpoint: { WatchpointOptions *wp_options = (WatchpointOptions *)io_handler.GetUserData(); - auto data_up = llvm::make_unique(); + auto data_up = std::make_unique(); data_up->user_source.SplitIntoLines(data); if (GenerateWatchpointCommandCallbackData(data_up->user_source, @@ -1290,7 +1290,7 @@ Status ScriptInterpreterPythonImpl::SetBreakpointCommandCallback( // Set a Python one-liner as the callback for the breakpoint. Status ScriptInterpreterPythonImpl::SetBreakpointCommandCallback( BreakpointOptions *bp_options, const char *command_body_text) { - auto data_up = llvm::make_unique(); + auto data_up = std::make_unique(); // Split the command_body_text into lines, and pass that to // GenerateBreakpointCommandCallbackData. That will wrap the body in an @@ -1313,7 +1313,7 @@ Status ScriptInterpreterPythonImpl::SetBreakpointCommandCallback( // Set a Python one-liner as the callback for the watchpoint. void ScriptInterpreterPythonImpl::SetWatchpointCommandCallback( WatchpointOptions *wp_options, const char *oneliner) { - auto data_up = llvm::make_unique(); + auto data_up = std::make_unique(); // It's necessary to set both user_source and script_source to the oneliner. // The former is used to generate callback description (as in watchpoint diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp index 551ef90..73ee7073 100644 --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp @@ -590,7 +590,7 @@ void SymbolFileBreakpad::ParseLineTableAndSupportFiles(CompileUnit &cu, "How did we create compile units without a base address?"); SupportFileMap map; - data.line_table_up = llvm::make_unique(&cu); + data.line_table_up = std::make_unique(&cu); std::unique_ptr line_seq_up( data.line_table_up->CreateLineSequenceContainer()); llvm::Optional next_addr; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp index 9ae047d..97dbd6c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp @@ -21,30 +21,30 @@ std::unique_ptr AppleDWARFIndex::Create( Module &module, DWARFDataExtractor apple_names, DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str) { - auto apple_names_table_up = llvm::make_unique( + auto apple_names_table_up = std::make_unique( apple_names, debug_str, ".apple_names"); if (!apple_names_table_up->IsValid()) apple_names_table_up.reset(); auto apple_namespaces_table_up = - llvm::make_unique( + std::make_unique( apple_namespaces, debug_str, ".apple_namespaces"); if (!apple_namespaces_table_up->IsValid()) apple_namespaces_table_up.reset(); - auto apple_types_table_up = llvm::make_unique( + auto apple_types_table_up = std::make_unique( apple_types, debug_str, ".apple_types"); if (!apple_types_table_up->IsValid()) apple_types_table_up.reset(); - auto apple_objc_table_up = llvm::make_unique( + auto apple_objc_table_up = std::make_unique( apple_objc, debug_str, ".apple_objc"); if (!apple_objc_table_up->IsValid()) apple_objc_table_up.reset(); if (apple_names_table_up || apple_names_table_up || apple_types_table_up || apple_objc_table_up) - return llvm::make_unique( + return std::make_unique( module, std::move(apple_names_table_up), std::move(apple_namespaces_table_up), std::move(apple_types_table_up), std::move(apple_objc_table_up)); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 100f35f..1e04bac 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -38,7 +38,7 @@ llvm::Expected DWARFDebugInfo::GetCompileUnitAranges() { if (m_cu_aranges_up) return *m_cu_aranges_up; - m_cu_aranges_up = llvm::make_unique(); + m_cu_aranges_up = std::make_unique(); const DWARFDataExtractor &debug_aranges_data = m_context.getOrLoadArangesData(); if (llvm::Error error = m_cu_aranges_up->extract(debug_aranges_data)) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp index 3b918cd..007ef2e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp @@ -24,7 +24,7 @@ DebugNamesDWARFIndex::Create(Module &module, DWARFDataExtractor debug_names, return llvm::make_error("debug info null", llvm::inconvertibleErrorCode()); } - auto index_up = llvm::make_unique(debug_names.GetAsLLVM(), + auto index_up = std::make_unique(debug_names.GetAsLLVM(), debug_str.GetAsLLVM()); if (llvm::Error E = index_up->extract()) return std::move(E); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 8df3fc6..0262827 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -474,7 +474,7 @@ void SymbolFileDWARF::InitializeObject() { } } - m_index = llvm::make_unique(*GetObjectFile()->GetModule(), + m_index = std::make_unique(*GetObjectFile()->GetModule(), DebugInfo()); } @@ -612,7 +612,7 @@ DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() { if (debug_abbrev_data.GetByteSize() == 0) return nullptr; - auto abbr = llvm::make_unique(); + auto abbr = std::make_unique(); llvm::Error error = abbr->parse(debug_abbrev_data); if (error) { Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO); @@ -635,7 +635,7 @@ DWARFDebugInfo *SymbolFileDWARF::DebugInfo() { Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION, static_cast(this)); if (m_context.getOrLoadDebugInfoData().GetByteSize() > 0) - m_info = llvm::make_unique(*this, m_context); + m_info = std::make_unique(*this, m_context); } return m_info.get(); } @@ -989,7 +989,7 @@ bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) { // into LLDB, we should explore using a callback to populate the line table // while we parse to reduce memory usage. std::unique_ptr line_table_up = - llvm::make_unique(&comp_unit); + std::make_unique(&comp_unit); LineSequence *sequence = line_table_up->CreateLineSequenceContainer(); for (auto &row : line_table->Rows) { line_table_up->AppendLineEntryToSequence( @@ -1585,7 +1585,7 @@ SymbolFileDWARF::GetDwoSymbolFileForCompileUnit( if (dwo_obj_file == nullptr) return nullptr; - return llvm::make_unique(dwo_obj_file, *dwarf_cu); + return std::make_unique(dwo_obj_file, *dwarf_cu); } void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() { diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp index 1838204..830d78f 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp @@ -130,7 +130,7 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) { if (!stream_data) { llvm::pdb::ModuleDebugStreamRef debug_stream(descriptor, nullptr); - cci = llvm::make_unique(PdbCompilandId{ modi }, debug_stream, std::move(descriptor)); + cci = std::make_unique(PdbCompilandId{ modi }, debug_stream, std::move(descriptor)); return *cci; } @@ -139,7 +139,7 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) { cantFail(debug_stream.reload()); - cci = llvm::make_unique( + cci = std::make_unique( PdbCompilandId{modi}, std::move(debug_stream), std::move(descriptor)); ParseExtendedInfo(m_index, *cci); diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index b12b51b..20c8733 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -91,10 +91,10 @@ static std::unique_ptr loadPDBFile(std::string PdbPath, std::unique_ptr Buffer = std::move(*ErrorOrBuffer); llvm::StringRef Path = Buffer->getBufferIdentifier(); - auto Stream = llvm::make_unique( + auto Stream = std::make_unique( std::move(Buffer), llvm::support::little); - auto File = llvm::make_unique(Path, std::move(Stream), Allocator); + auto File = std::make_unique(Path, std::move(Stream), Allocator); if (auto EC = File->parseFileHeaders()) { llvm::consumeError(std::move(EC)); return nullptr; @@ -333,7 +333,7 @@ void SymbolFileNativePDB::InitializeObject() { ts_or_err->SetSymbolFile(this); auto *clang = llvm::cast_or_null(&ts_or_err.get()); lldbassert(clang); - m_ast = llvm::make_unique(*m_objfile_sp, *m_index, *clang); + m_ast = std::make_unique(*m_objfile_sp, *m_index, *clang); } } @@ -1068,7 +1068,7 @@ bool SymbolFileNativePDB::ParseLineTable(CompileUnit &comp_unit) { CompilandIndexItem *cci = m_index->compilands().GetCompiland(cu_id.asCompiland().modi); lldbassert(cci); - auto line_table = llvm::make_unique(&comp_unit); + auto line_table = std::make_unique(&comp_unit); // This is basically a copy of the .debug$S subsections from all original COFF // object files merged together with address relocations applied. We are diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 518cafb..59c0b5c 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -1800,7 +1800,7 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(CompileUnit &comp_unit, // to do a mapping so that we can hand out indices. llvm::DenseMap index_map; BuildSupportFileIdToSupportFileIndexMap(*compiland_up, index_map); - auto line_table = llvm::make_unique(&comp_unit); + auto line_table = std::make_unique(&comp_unit); // Find contributions to `compiland` from all source and header files. std::string path = comp_unit.GetPath(); diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 4eac3ab..6e1c90a 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -8444,7 +8444,7 @@ ClangASTContext::CreateBaseClassSpecifier(lldb::opaque_compiler_type_t type, if (!type) return nullptr; - return llvm::make_unique( + return std::make_unique( clang::SourceRange(), is_virtual, base_of_class, ClangASTContext::ConvertAccessTypeToAccessSpecifier(access), getASTContext()->getTrivialTypeSourceInfo(GetQualType(type)), diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 3fb8570..fac9b56 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -384,7 +384,7 @@ Platform::Platform(bool is_host) m_rsync_opts(), m_rsync_prefix(), m_supports_ssh(false), m_ssh_opts(), m_ignores_remote_hostname(false), m_trap_handlers(), m_calculated_trap_handlers(false), - m_module_cache(llvm::make_unique()) { + m_module_cache(std::make_unique()) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT)); LLDB_LOGF(log, "%p Platform::Platform()", static_cast(this)); } diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp index 90cfca2..6066bd9 100644 --- a/lldb/source/Utility/Reproducer.cpp +++ b/lldb/source/Utility/Reproducer.cpp @@ -175,7 +175,7 @@ void Generator::AddProvidersToIndex() { index.AppendPathComponent("index.yaml"); std::error_code EC; - auto strm = llvm::make_unique(index.GetPath(), EC, + auto strm = std::make_unique(index.GetPath(), EC, sys::fs::OpenFlags::OF_None); yaml::Output yout(*strm); @@ -223,7 +223,7 @@ bool Loader::HasFile(StringRef file) { llvm::Expected> DataRecorder::Create(const FileSpec &filename) { std::error_code ec; - auto recorder = llvm::make_unique(std::move(filename), ec); + auto recorder = std::make_unique(std::move(filename), ec); if (ec) return llvm::errorCodeToError(ec); return std::move(recorder); diff --git a/lldb/source/Utility/StructuredData.cpp b/lldb/source/Utility/StructuredData.cpp index 0e203f9..fde5093 100644 --- a/lldb/source/Utility/StructuredData.cpp +++ b/lldb/source/Utility/StructuredData.cpp @@ -47,7 +47,7 @@ StructuredData::ParseJSONFromFile(const FileSpec &input_spec, Status &error) { static StructuredData::ObjectSP ParseJSONObject(JSONParser &json_parser) { // The "JSONParser::Token::ObjectStart" token should have already been // consumed by the time this function is called - auto dict_up = llvm::make_unique(); + auto dict_up = std::make_unique(); std::string value; std::string key; @@ -78,7 +78,7 @@ static StructuredData::ObjectSP ParseJSONObject(JSONParser &json_parser) { static StructuredData::ObjectSP ParseJSONArray(JSONParser &json_parser) { // The "JSONParser::Token::ObjectStart" token should have already been // consumed by the time this function is called - auto array_up = llvm::make_unique(); + auto array_up = std::make_unique(); std::string value; std::string key; diff --git a/lldb/tools/lldb-instr/Instrument.cpp b/lldb/tools/lldb-instr/Instrument.cpp index f30707c..9b29700 100644 --- a/lldb/tools/lldb-instr/Instrument.cpp +++ b/lldb/tools/lldb-instr/Instrument.cpp @@ -335,7 +335,7 @@ public: std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef File) override { MyRewriter.setSourceMgr(CI.getSourceManager(), CI.getLangOpts()); - return llvm::make_unique(MyRewriter, CI.getASTContext()); + return std::make_unique(MyRewriter, CI.getASTContext()); } private: @@ -348,8 +348,8 @@ int main(int argc, const char **argv) { "instrumentation framework."); auto PCHOpts = std::make_shared(); - PCHOpts->registerWriter(llvm::make_unique()); - PCHOpts->registerReader(llvm::make_unique()); + PCHOpts->registerWriter(std::make_unique()); + PCHOpts->registerReader(std::make_unique()); ClangTool T(OP.getCompilations(), OP.getSourcePathList(), PCHOpts); return T.run(newFrontendActionFactory().get()); diff --git a/lldb/tools/lldb-server/lldb-server.cpp b/lldb/tools/lldb-server/lldb-server.cpp index 690aa62..518c34b 100644 --- a/lldb/tools/lldb-server/lldb-server.cpp +++ b/lldb/tools/lldb-server/lldb-server.cpp @@ -39,7 +39,7 @@ int main_platform(int argc, char *argv[]); namespace llgs { static void initialize() { if (auto e = g_debugger_lifetime->Initialize( - llvm::make_unique(), nullptr)) + std::make_unique(), nullptr)) llvm::consumeError(std::move(e)); } diff --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp index e522f94..8d0ef68 100644 --- a/lldb/tools/lldb-test/lldb-test.cpp +++ b/lldb/tools/lldb-test/lldb-test.cpp @@ -969,7 +969,7 @@ int main(int argc, const char *argv[]) { SystemLifetimeManager DebuggerLifetime; if (auto e = DebuggerLifetime.Initialize( - llvm::make_unique(), nullptr)) { + std::make_unique(), nullptr)) { WithColor::error() << "initialization failed: " << toString(std::move(e)) << '\n'; return 1; diff --git a/lldb/unittests/Host/MainLoopTest.cpp b/lldb/unittests/Host/MainLoopTest.cpp index d77bd09..7d5421a 100644 --- a/lldb/unittests/Host/MainLoopTest.cpp +++ b/lldb/unittests/Host/MainLoopTest.cpp @@ -110,7 +110,7 @@ TEST_F(MainLoopTest, DetectsEOF) { PseudoTerminal term; ASSERT_TRUE(term.OpenFirstAvailableMaster(O_RDWR, nullptr, 0)); ASSERT_TRUE(term.OpenSlave(O_RDWR | O_NOCTTY, nullptr, 0)); - auto conn = llvm::make_unique( + auto conn = std::make_unique( term.ReleaseMasterFileDescriptor(), true); Status error; diff --git a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp index adc65d4..3d0f628 100644 --- a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp +++ b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp @@ -51,7 +51,7 @@ TEST(RegisterContextMinidump, ConvertMinidumpContext_x86_32) { sizeof(Context)); ArchSpec arch("i386-pc-linux"); - auto RegInterface = llvm::make_unique(arch); + auto RegInterface = std::make_unique(arch); lldb::DataBufferSP Buf = ConvertMinidumpContext_x86_32(ContextRef, RegInterface.get()); ASSERT_EQ(RegInterface->GetGPRSize(), Buf->GetByteSize()); @@ -112,7 +112,7 @@ TEST(RegisterContextMinidump, ConvertMinidumpContext_x86_64) { sizeof(Context)); ArchSpec arch("x86_64-pc-linux"); - auto RegInterface = llvm::make_unique(arch); + auto RegInterface = std::make_unique(arch); lldb::DataBufferSP Buf = ConvertMinidumpContext_x86_64(ContextRef, RegInterface.get()); ASSERT_EQ(RegInterface->GetGPRSize(), Buf->GetByteSize()); diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp index de4c46b..e4f1a92 100644 --- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp +++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp @@ -319,7 +319,7 @@ StopReplyStop::create(StringRef Response, support::endianness Endian, if (!RegistersOr) return RegistersOr.takeError(); - return llvm::make_unique(Signal, Thread, Name, + return std::make_unique(Signal, Thread, Name, std::move(ThreadPcs), std::move(*RegistersOr), Reason); } @@ -329,7 +329,7 @@ StopReplyExit::create(StringRef Response) { uint8_t Status; if (!to_integer(Response, Status, 16)) return make_parsing_error("StopReply: exit status"); - return llvm::make_unique(Status); + return std::make_unique(Status); } //====== Globals =============================================================== diff --git a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp index 9f98bb4..7e51a38 100644 --- a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp +++ b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp @@ -111,7 +111,7 @@ Expected> TestClient::launchCustom(StringRef Log, Ar Socket *accept_socket; listen_socket.Accept(accept_socket); - auto Conn = llvm::make_unique(accept_socket); + auto Conn = std::make_unique(accept_socket); auto Client = std::unique_ptr(new TestClient(std::move(Conn))); if (Error E = Client->initializeConnection()) -- 2.7.4