From patchwork Tue Nov 21 12:04:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 80460 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0F65385802A for ; Tue, 21 Nov 2023 12:06:12 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2082.outbound.protection.outlook.com [40.107.93.82]) by sourceware.org (Postfix) with ESMTPS id C43CD3858292 for ; Tue, 21 Nov 2023 12:05:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C43CD3858292 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C43CD3858292 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.93.82 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700568357; cv=pass; b=R/a9k62rHFgR3Ml/OGXYos5kwaBEEV+zsb2D8cf3OWn0IMmTU5PQukUwS+CAA5ifBcRDF1ZE+GB8Fhjt6US15mujs7gqBshOTsLdHbZlGZeqAuwL8YukDLMsD2mGyjBevC3/q/SyfuMPFkKI/nO2sQ7PnTdWqtkuDQeIuRYR9fs= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700568357; c=relaxed/simple; bh=AetTcozEbwn0pZKJioNQZZqzpCYTaUbw9PcL5Q9J2j0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oV8DXQ5hkNJDgPV7GyM9Id8BGaTDJgJWmrhfRWJZf9mYQJJz3HrKAumI+fnAh9v/OUryN6//BHZWdVmQ6CF0wGw/FuqMX4w+l6TLuFCpVkvRxCWCSXpuZZtflgvjv8lKa85t419jVCGOZ64mLnuGvJ+xBuHyAFcCpu5s55EqrNA= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVzGmRR2b8mb7+zwyZYWa1KkOpVdgSGuXF4KZLcaAm7XyMNA0/p9wIO578zsVXqluGyk1bTcR8aZH1CFKYAk+WC88INQIuAwEFUbxrC+p1W8yKeMYI2vbPNPxM5SfLsCVYeQiQsTbt7mKRnLvW8ywj0eApXxyPoCKvaaAuog2qtF1+WecbWbBmZ/fBDqkruf/jRqqS40d3EmFK0CrOK3rcCPH9gfF5GJkfxgYXss7qTPc9wnaYMwXpOESqNAxKrlAs9MuYxKks0DNyueiFqy7Jl3RzQDBOpQT8nd1hXeEtQc+mhmOgIwseS/50SJ31HnP98+4z1UPY15KLAdJ4htnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/z4YU9Qc3nzQLv83hoOcTOXoGve9WscR280pOxnrbc0=; b=AULLHodfoH8mNdHtBB5CIOGBy7Py45FQttZbGnIS2iSepqHQBY5uWI7O26oKLtnzaLqXnj/dbbUV/X474vDqp9fR0TgHhLLqXIozTq8d/rRUX3saW/8bbj0wIx065gfJrwBIe8Ij4RVGwlgM95UO6owiaYgqFA8nMr3kfVTZUXSInkBKgbIOuZ4R9AzYzY6NIQPv29Du036WhaonCpkDGCT/ndcR6JiDa4bXq2CgQaW634J0ex81T63Vgj7CL8ZDqGw1dMTktPCgk8fe5hu22UeWMFXjGGuSGlEpKmqgfd1lmuYWUoi150kpkL2jFM48j9FbiUlkVfHDV82ViEtqtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/z4YU9Qc3nzQLv83hoOcTOXoGve9WscR280pOxnrbc0=; b=mPgrXOuBhjDHj7DvI0/obwDBlKyjt6SboFb6Jzo9kulbpEgVIm7u2HoBeeL0HvqrTLgcKwDm9b8Or7/GCNcReSiJ0C/rqJltkXyGdhXQNUct9dXmTCgNmJmrx5S/CJsYq5zEurS5XM6Agm+tCM6VGS9Gh2Sbmwku1CHgBjkjCQo= Received: from MN2PR12CA0022.namprd12.prod.outlook.com (2603:10b6:208:a8::35) by CY8PR12MB7538.namprd12.prod.outlook.com (2603:10b6:930:95::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.28; Tue, 21 Nov 2023 12:05:50 +0000 Received: from MN1PEPF0000F0E4.namprd04.prod.outlook.com (2603:10b6:208:a8:cafe::77) by MN2PR12CA0022.outlook.office365.com (2603:10b6:208:a8::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.27 via Frontend Transport; Tue, 21 Nov 2023 12:05:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000F0E4.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Tue, 21 Nov 2023 12:05:50 +0000 Received: from hpe6u-23.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 21 Nov 2023 06:05:49 -0600 From: Lancelot Six To: CC: , , Lancelot Six Subject: [COMMITTED PATCH v2 1/9] gdb: Use C++17's std::make_unique instead of gdb::make_unique Date: Tue, 21 Nov 2023 12:04:52 +0000 Message-ID: <20231121120500.1394523-2-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231028204821.fp5hh7bahrmrnpjl@hpe6u-23> References: <20231028204821.fp5hh7bahrmrnpjl@hpe6u-23> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E4:EE_|CY8PR12MB7538:EE_ X-MS-Office365-Filtering-Correlation-Id: a3f9e5a1-1428-4f0e-58da-08dbea8a33ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G/7e0OXZDeWbvLeo5yJQaZCf01Cjp1ZjZ2pErkz0ydx7y00Q47lhWXENuRjYHfevAq9pMRnpsmC4qDJnrKO9DhuX/tNOASZcR8d2Xy7q2MtCoMrLBOg+9R7hJhqk0Ndmqi0XJ2WE/+OK8jiQnHP2Qrn0PPT7yFNsT4eAXk6TcA/zmlUzxSSHCDTbjf5AiDsSQS87evptiB8A0E/m94vjb3IN45nQ5K+QsEduv/HAicSaUdyEcAPK3mo9r3+HH+OHPet3cAViSglGWEbqilMF0rUzaJr9fMPaBZXy08rbbs4kCbY4aqCUcWVHJgIiazYIELCgRbEckKPCosbEhScdQQA0CKKL7jDKqzlEG1Nrei/piZs/ukeImBPBhJuyQouV2ZxBC3KNLu5GmoiSByKVqoiDCYlAqUgZWibUAlEGLd0qQfXW124wLlRdorUk9vTuIPCaijSdD3qsvd6NgYntqiGdpITcRKOFh/uUPtASA2WqmxnA8jiu4PUrUZP5Xa+Yx+cwt2/2+7McbU7UGUEdyEJ9PmoVpfX/25xO537Obt6L5EQCPLJgCa8lfQ7aXwZ/Hm/iYSE099Z0cOrzVQNE5IXvynkfCokuyFzH1b/VtRLabA6x+UGggnI2KYEjBk46qvht4U5hvDpGtHt9UCj3vVrIHnplnrgxd7zfTEi//vOXSUQHNLdQ69JvOhsXtuQbshriVmKnZy2EExlR40wupfnewgUVQ3990uhPYOqt/iVZHH+GxCVMCZhARTpjBhwqY7Cu4k3qIWJLC4FBk5cfKw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(376002)(39860400002)(346002)(230922051799003)(186009)(451199024)(1800799012)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(2906002)(30864003)(5660300002)(44832011)(40480700001)(41300700001)(4326008)(8936002)(8676002)(6916009)(316002)(54906003)(70206006)(70586007)(40460700003)(47076005)(86362001)(1076003)(26005)(478600001)(16526019)(6666004)(36756003)(7696005)(2616005)(336012)(426003)(356005)(81166007)(83380400001)(36860700001)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2023 12:05:50.0076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3f9e5a1-1428-4f0e-58da-08dbea8a33ee X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7538 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org gdb::make_unique is a wrapper around std::make_unique when compiled with C++17. Now that C++17 is required, use std::make_unique directly in the codebase, and remove gdb::make_unique. Change-Id: I80b615e46e4b7c097f09d78e579a9bdce00254ab Approved-By: Tom Tromey Approved-By: Pedro Alves (); + auto map = std::make_unique (); SELF_CHECK (map != nullptr); /* Check initial state. */ diff --git a/gdb/break-catch-load.c b/gdb/break-catch-load.c index 02a98b5d30a..dbf70d8f204 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -230,7 +230,7 @@ add_solib_catchpoint (const char *arg, bool is_load, bool is_temp, bool enabled) if (*arg == '\0') arg = nullptr; - auto c = gdb::make_unique (gdbarch, is_temp, nullptr, + auto c = std::make_unique (gdbarch, is_temp, nullptr, is_load, arg); c->enable_state = enabled ? bp_enabled : bp_disabled; diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c index 53b7285b366..3a3e4d21136 100644 --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c @@ -118,7 +118,7 @@ get_compile_context (const char *fe_libcc, const char *fe_context, error (_("The loaded version of GCC does not support the required version " "of the API.")); - return gdb::make_unique (context); + return std::make_unique (context); } /* A C-language implementation of get_compile_context. */ diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 324166a03ff..e6c8c4c09a9 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -2038,7 +2038,7 @@ cp_demangled_name_to_comp (const char *demangled_name, state.demangle_info = allocate_info (); - auto result = gdb::make_unique (); + auto result = std::make_unique (); result->info = state.demangle_info; if (yyparse (&state)) diff --git a/gdb/cp-support.c b/gdb/cp-support.c index e02e859b99a..834c4774755 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -675,7 +675,7 @@ mangled_name_to_comp (const char *mangled_name, int options, options, memory); if (ret) { - auto info = gdb::make_unique (); + auto info = std::make_unique (); info->tree = ret; *demangled_p = NULL; return info; diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index abc8d613482..d72dd0ad971 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -2126,7 +2126,7 @@ dwarf2_build_frame_info (struct objfile *objfile) struct gdbarch *gdbarch = objfile->arch (); /* Build a minimal decoding of the DWARF2 compilation unit. */ - auto unit = gdb::make_unique (objfile); + auto unit = std::make_unique (objfile); if (objfile->separate_debug_objfile_backlink == NULL) { diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c index c1b62b38f93..78e0df27314 100644 --- a/gdb/dwarf2/read-debug-names.c +++ b/gdb/dwarf2/read-debug-names.c @@ -464,7 +464,7 @@ create_cus_from_debug_names (dwarf2_per_bfd *per_bfd, bool dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile) { - auto map = gdb::make_unique (); + auto map = std::make_unique (); mapped_debug_names dwz_map; struct objfile *objfile = per_objfile->objfile; dwarf2_per_bfd *per_bfd = per_objfile->per_bfd; diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index e789e9c2654..064a9f17b0e 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -828,7 +828,7 @@ dwarf2_read_gdb_index if (main_index_contents.empty ()) return 0; - auto map = gdb::make_unique (); + auto map = std::make_unique (); if (!read_gdb_index_from_buffer (objfile_name (objfile), use_deprecated_index_sections, main_index_contents, map.get (), &cu_list, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index e8ff4d8f29a..2a7fd8f5de5 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -4372,7 +4372,7 @@ allocate_type_unit_groups_table () static std::unique_ptr create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct) { - auto tu_group = gdb::make_unique (); + auto tu_group = std::make_unique (); tu_group->hash.dwo_unit = cu->dwo_unit; tu_group->hash.line_sect_off = line_offset_struct; diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index 56a4c5ecc91..b72821f4c35 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -303,7 +303,7 @@ gdb_bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, const char *target) { std::unique_ptr buffer - = gdb::make_unique (addr, size); + = std::make_unique (addr, size); return gdb_bfd_openr_iovec (buffer->filename (), target, [&] (bfd *nbfd) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 7011fddd695..e424077c1c0 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5833,7 +5833,7 @@ static const struct registry::key void allocate_fixed_point_type_info (struct type *type) { - auto up = gdb::make_unique (); + auto up = std::make_unique (); fixed_point_type_info *info; if (type->is_objfile_owned ()) diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index abcd0d392ba..14ed2a1fae9 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1932,7 +1932,7 @@ mi_execute_command (const char *cmd, int from_tty) = gdb::checked_static_cast (command_interp ()); try { - command = gdb::make_unique (cmd, &token); + command = std::make_unique (cmd, &token); } catch (const gdb_exception &exception) { diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index bbd21287b28..0bc13f963bc 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -340,13 +340,13 @@ std::unique_ptr mi_out_new (const char *mi_version) { if (streq (mi_version, INTERP_MI4) || streq (mi_version, INTERP_MI)) - return gdb::make_unique (4); + return std::make_unique (4); if (streq (mi_version, INTERP_MI3)) - return gdb::make_unique (3); + return std::make_unique (3); if (streq (mi_version, INTERP_MI2)) - return gdb::make_unique (2); + return std::make_unique (2); return nullptr; } diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index 3c217daa488..c0cebbb2f02 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -468,7 +468,7 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf) error (_("BTS support has been disabled for the target cpu.")); std::unique_ptr tinfo - { gdb::make_unique (ptid) }; + { std::make_unique (ptid) }; tinfo->conf.format = BTRACE_FORMAT_BTS; @@ -617,7 +617,7 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) pid = ptid.pid (); std::unique_ptr tinfo - { gdb::make_unique (ptid) }; + { std::make_unique (ptid) }; tinfo->conf.format = BTRACE_FORMAT_PT; diff --git a/gdb/python/py-mi.c b/gdb/python/py-mi.c index a7b4f4fa3cf..aaa225da95e 100644 --- a/gdb/python/py-mi.c +++ b/gdb/python/py-mi.c @@ -290,7 +290,7 @@ gdbpy_execute_mi_command (PyObject *self, PyObject *args, PyObject *kw) try { scoped_restore save_uiout = make_scoped_restore (¤t_uiout, &uiout); - auto parser = gdb::make_unique (std::move (mi_command), + auto parser = std::make_unique (std::move (mi_command), std::move (arg_strings)); mi_execute_command (parser.get ()); } diff --git a/gdb/python/py-varobj.c b/gdb/python/py-varobj.c index 98603cec009..3401cf294ac 100644 --- a/gdb/python/py-varobj.c +++ b/gdb/python/py-varobj.c @@ -170,5 +170,5 @@ py_varobj_get_iterator (struct varobj *var, PyObject *printer, error (_("Could not get children iterator")); } - return gdb::make_unique (var, std::move (iter), opts); + return std::make_unique (var, std::move (iter), opts); } diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index c8fa865f49d..0fc3a153973 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -484,7 +484,7 @@ solib_aix_current_sos () new_solib->so_original_name = so_name; new_solib->so_name = so_name; - new_solib->lm_info = gdb::make_unique (info); + new_solib->lm_info = std::make_unique (info); /* Add it to the list. */ sos.push_back (*new_solib); diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index c18791cd7c2..4819afe8863 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -274,7 +274,7 @@ darwin_current_sos () /* Create and fill the new struct shobj element. */ shobj *newobj = new shobj; - auto li = gdb::make_unique (); + auto li = std::make_unique (); newobj->so_name = file_path.get (); newobj->so_original_name = newobj->so_name; diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 65bb6251a0e..ef561466945 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -594,7 +594,7 @@ dsbt_current_sos (void) } shobj *sop = new shobj; - auto li = gdb::make_unique (); + auto li = std::make_unique (); li->map = loadmap; /* Fetch the name. */ addr = extract_unsigned_integer (lm_buf.l_name, diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 0897bce2325..7ca28982638 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -377,7 +377,7 @@ frv_current_sos () } shobj *sop = new shobj; - auto li = gdb::make_unique (); + auto li = std::make_unique (); li->map = loadmap; li->got_value = got_addr; li->lm_addr = lm_addr; diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c index 3a971b3361e..cf56a81a2ee 100644 --- a/gdb/solib-rocm.c +++ b/gdb/solib-rocm.c @@ -212,7 +212,7 @@ so_list_from_rocm_sos (const std::vector &sos) for (const rocm_so &so : sos) { struct shobj *newobj = new struct shobj; - newobj->lm_info = gdb::make_unique (*so.lm_info); + newobj->lm_info = std::make_unique (*so.lm_info); newobj->so_name = so.name; newobj->so_original_name = so.unique_name; @@ -725,7 +725,7 @@ rocm_update_solib_list () gdb::unique_xmalloc_ptr uri_bytes_holder (uri_bytes); - lm_info_svr4_up li = gdb::make_unique (); + lm_info_svr4_up li = std::make_unique (); li->l_addr = l_addr; /* Generate a unique name so that code objects with the same URI but diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 8a5ad590f6f..5882a4e0070 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -213,7 +213,7 @@ lm_info_read (CORE_ADDR lm_addr) type *ptr_type = builtin_type (current_inferior ()->arch ())->builtin_data_ptr; - lm_info = gdb::make_unique (); + lm_info = std::make_unique (); lm_info->lm_addr = lm_addr; lm_info->l_addr_inferior = extract_typed_address (&lm[lmo->l_addr_offset], @@ -1001,7 +1001,7 @@ so_list_from_svr4_sos (const std::vector &sos) newobj->so_name = so.name; newobj->so_original_name = so.name; - newobj->lm_info = gdb::make_unique (*so.lm_info); + newobj->lm_info = std::make_unique (*so.lm_info); dst.push_back (*newobj); } @@ -1032,7 +1032,7 @@ library_list_start_library (struct gdb_xml_parser *parser, ULONGEST *l_ldp = (ULONGEST *) xml_find_attribute (attributes, "l_ld")->value.get (); - lm_info_svr4_up li = gdb::make_unique (); + lm_info_svr4_up li = std::make_unique (); li->lm_addr = *lmp; li->l_addr_inferior = *l_addrp; li->l_ld = *l_ldp; @@ -1190,7 +1190,7 @@ svr4_default_sos (svr4_info *info) return {}; shobj *newobj = new shobj; - auto li = gdb::make_unique (); + auto li = std::make_unique (); /* Nothing will ever check the other fields if we set l_addr_p. */ li->l_addr = li->l_addr_inferior = info->debug_loader_offset; diff --git a/gdb/ui-out.c b/gdb/ui-out.c index defa8f9dfa4..e8653c6c127 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -236,7 +236,7 @@ void ui_out_table::append_header (int width, ui_align alignment, internal_error (_("table header must be specified after table_begin and " "before table_body.")); - auto header = gdb::make_unique (m_headers.size () + 1, + auto header = std::make_unique (m_headers.size () + 1, width, alignment, col_name, col_hdr); @@ -328,7 +328,7 @@ ui_out::current_level () const void ui_out::push_level (ui_out_type type) { - auto level = gdb::make_unique (type); + auto level = std::make_unique (type); m_levels.push_back (std::move (level)); } diff --git a/gdb/unittests/parallel-for-selftests.c b/gdb/unittests/parallel-for-selftests.c index 1ad7eaa701c..63e9512ea18 100644 --- a/gdb/unittests/parallel-for-selftests.c +++ b/gdb/unittests/parallel-for-selftests.c @@ -160,7 +160,7 @@ TEST (int n_threads) { if (start == end) any_empty_tasks = true; - return gdb::make_unique (end - start); + return std::make_unique (end - start); }); SELF_CHECK (!any_empty_tasks); SELF_CHECK (std::all_of (intresults.begin (), @@ -178,7 +178,7 @@ TEST (int n_threads) { if (start == end) any_empty_tasks = true; - return gdb::make_unique (end - start); + return std::make_unique (end - start); }, task_size_one); SELF_CHECK (!any_empty_tasks); diff --git a/gdb/varobj.c b/gdb/varobj.c index a4fcbffc311..4ea8d0fd9b3 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -259,7 +259,7 @@ varobj_create (const char *objname, const char *expression, CORE_ADDR frame, enum varobj_type type) { /* Fill out a varobj structure for the (root) variable being constructed. */ - auto var = gdb::make_unique (new varobj_root); + auto var = std::make_unique (new varobj_root); if (expression != NULL) { diff --git a/gdbsupport/gdb_unique_ptr.h b/gdbsupport/gdb_unique_ptr.h index 2b6c0ce3d53..3bef6ff34d6 100644 --- a/gdbsupport/gdb_unique_ptr.h +++ b/gdbsupport/gdb_unique_ptr.h @@ -56,19 +56,6 @@ struct noop_deleter void operator() (T *ptr) const { } }; -/* Create simple std::unique_ptr objects. */ - -template -std::unique_ptr -make_unique (Arg &&...args) -{ -#if __cplusplus >= 201402L - return std::make_unique (std::forward (args)...); -#else - return std::unique_ptr (new T (std::forward (args)...)); -#endif /* __cplusplus < 201402L */ -} - } /* namespace gdb */ /* Dup STR and return a unique_xmalloc_ptr for the result. */