From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by sourceware.org (Postfix) with ESMTPS id BE0A03856DDF for ; Fri, 13 Oct 2023 14:44:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE0A03856DDF 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-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TFMw2iuc+MyM3lIsNiLE9Fq9LLmtsRjYYDDnqTLiqHqxgD9EkorVOdWiLcLzLg8OVBAVwl7sCrZuAP//dmZ8ZuNql7QotWBwm0sbLjYdXRqEhdcwWwehsbtwku4TzCDvFbaJ8P4+AgbpWgcu0NPOe6ppGdumBOjwzs6giFNjTZ1j424GFfzFh0195obNkQYfA85VcUidFEfqguXWI4jt/Pwt0JDeD7HEp/gKCuOLnh/FBLppncczJwZbLfwEpD74aDAAd50fJwcgZxmTqNpq3dlCX9L5RJoz2DMGkrB2A8Rx2wJ53wcEchouagdZYvH6EVf65Rta6Q4cd7f2coQumg== 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=aapZX7+VhI7PCMUpU1NwZ0REYtL5IBbueP2BITMkv4w=; b=hTgrOg+Fg3pqfAP5790ek0VqS8vamDTCVPQtXM30HefB4lmtly6q/GHhk6JELw4zfKiYiDqsXu/YkWSQMKWkrYYL4BPOgNy0XyxKis0v5FzmyNeXBYTPtUx8+pFlj3I0KyktivzKZAD9tOfdVZRXl9FmY2KxPwGfe372akIIPSACsgacv2lbyAL0RreslPlKIZc20UWnprleDI9k34OrHFa2PJVshTto2wvU1Jm279TcGIUy0LoLeLXXWXFOxrAEK8jk8lq8tmfs9JlL0/TzLftwqBpSAUedGYKUf1HLw4xTTca6pbcFklUExM3GblEU6bRJApMGbpKF2JjqcswiNg== 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 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=aapZX7+VhI7PCMUpU1NwZ0REYtL5IBbueP2BITMkv4w=; b=EMYUzZFVXBgG3jJ3Y3EIBarSTxR09/jwy15+GTrqUJbVkozFrJY7sN1txnJRQue6tsiy9oXXZgOsYxHdIc72ELahAo5qAWdnw/IivHPX9yrlab6DdZ8RAGcGt1IatCwF+DWdGnvh2PvvH2TnPIYWQP+47teAePWvUGbKyU1AUrk= Received: from DM6PR11CA0008.namprd11.prod.outlook.com (2603:10b6:5:190::21) by SA0PR12MB4576.namprd12.prod.outlook.com (2603:10b6:806:93::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Fri, 13 Oct 2023 14:44:56 +0000 Received: from DS1PEPF00017096.namprd05.prod.outlook.com (2603:10b6:5:190:cafe::fc) by DM6PR11CA0008.outlook.office365.com (2603:10b6:5:190::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.30 via Frontend Transport; Fri, 13 Oct 2023 14:44:56 +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 DS1PEPF00017096.mail.protection.outlook.com (10.167.18.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Fri, 13 Oct 2023 14:44:56 +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.27; Fri, 13 Oct 2023 09:44:54 -0500 From: Lancelot Six To: CC: Lancelot Six Subject: [PATCH 03/11] gdb: Use C++17's std::make_unique instead of gdb::make_unique Date: Fri, 13 Oct 2023 14:44:10 +0000 Message-ID: <20231013144418.3180617-4-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013144418.3180617-1-lancelot.six@amd.com> References: <20231013144418.3180617-1-lancelot.six@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017096:EE_|SA0PR12MB4576:EE_ X-MS-Office365-Filtering-Correlation-Id: a970dd61-6d3e-4f57-d377-08dbcbfaf7bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rcuVxXpn4y8U5L+b6C6Zc/XcBXLIe++o4EmJsoR44dvfMf4Yl+yKM838//mnvH+nK5ApU0klWwmrZtBNtiVYJB31CMiDpmwtGYFRWixcGkw0iGhG0unaC9iS1PLksr4UaAy1XGL87sHb6e4av+2Gtxy0O8c4ctiwBTdObK0LxSBiXvLJoCSEOetqPWX8F0Cn8i9p7ilLuA05pjOGQGjFZiNx/I0xZDQv/bhwPXeqKNAG3wOHKnt4U/NbeGB0XIuxUu3J71ww1JBPirt4RjX8zdB486jNSHN5+yM3u8Mf4MesKIjAMY3/1Yedro5XSCZ+IdslA0FF32gEMSPXljvyegP6JeSLqsb41Opk0TWtssd52KpFIgYmFkAe/dS6wJl3XKKFRxOuXIXojWGGFS49foIs9Sx5sJYsgneYXa8SR3nV2mdePBgXvcO8QPgnSA/INSt+aBtCbW/zK+cmn7+Gh+9XwdXE4zUy5gg2mt0waq00vORbXg2/l6vuZ1bfsXJGs2thqHEOnoc1zZJP5soYGu29zKkguuXVyDCyhcA5W0FYgZgT2R65C5/JCM2SdRR6k1+Wv5ucwJa8hskcoEqR7kemBw7D9JxeM9tGbQwrtIuZqAOPtolTV3Yrr7r/LmE4hCQ3YmZiyB3mIGNQ5d0WBGHgZiquPTnrEf0kJxC3Elw6twhq2P3FZvb1F8zUnvpDOGTU2ijRy+MomZhr5qDVFPoF2NhvqcFcsTnGWjO2GlshRMbqk9eXn4fhcP3ONN0il/yKXbFjGGIY+fjxRtWfQQ== 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)(346002)(136003)(376002)(39860400002)(396003)(230922051799003)(1800799009)(186009)(82310400011)(451199024)(64100799003)(36840700001)(40470700004)(46966006)(1076003)(2616005)(40460700003)(356005)(36756003)(86362001)(81166007)(40480700001)(82740400003)(36860700001)(16526019)(47076005)(26005)(426003)(336012)(30864003)(44832011)(83380400001)(2906002)(7696005)(6666004)(478600001)(8676002)(6916009)(4326008)(8936002)(316002)(41300700001)(70206006)(70586007)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 14:44:56.0195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a970dd61-6d3e-4f57-d377-08dbcbfaf7bb 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: DS1PEPF00017096.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4576 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- gdb/addrmap.c | 3 ++- gdb/break-catch-load.c | 3 ++- gdb/compile/compile-c-support.c | 3 ++- gdb/cp-name-parser.y | 3 ++- gdb/cp-support.c | 3 ++- gdb/dwarf2/frame.c | 3 ++- gdb/dwarf2/read-debug-names.c | 3 ++- gdb/dwarf2/read-gdb-index.c | 3 ++- gdb/dwarf2/read.c | 3 ++- gdb/gdb_bfd.c | 2 +- gdb/gdbtypes.c | 3 ++- gdb/mi/mi-main.c | 3 ++- gdb/mi/mi-out.c | 7 ++++--- gdb/nat/linux-btrace.c | 5 +++-- gdb/python/py-mi.c | 3 ++- gdb/python/py-varobj.c | 3 ++- gdb/ui-out.c | 4 ++-- gdb/unittests/parallel-for-selftests.c | 5 +++-- gdb/varobj.c | 3 ++- gdbsupport/gdb_unique_ptr.h | 13 ------------- 20 files changed, 41 insertions(+), 37 deletions(-) diff --git a/gdb/addrmap.c b/gdb/addrmap.c index d16775d49d4..757947abaf4 100644 --- a/gdb/addrmap.c +++ b/gdb/addrmap.c @@ -21,6 +21,7 @@ #include "gdbsupport/gdb_obstack.h" #include "addrmap.h" #include "gdbsupport/selftest.h" +#include /* Make sure splay trees can actually hold the values we want to store in them. */ @@ -428,7 +429,7 @@ test_addrmap () /* Create mutable addrmap. */ auto_obstack temp_obstack; - auto map = gdb::make_unique (); + 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 94d8b420d32..cac914d3fac 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -28,6 +28,7 @@ #include "solist.h" #include "target.h" #include "valprint.h" +#include /* An instance of this type is used to represent an solib catchpoint. A breakpoint is really of this type iff its ops pointer points to @@ -230,7 +231,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..20a7bb4e0d4 100644 --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c @@ -30,6 +30,7 @@ #include "gdbsupport/gdb-dlfcn.h" #include "gdbsupport/preprocessor.h" #include "gdbarch.h" +#include /* See compile-internal.h. */ @@ -118,7 +119,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..061882363be 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -45,6 +45,7 @@ #include "cp-support.h" #include "c-support.h" #include "parser-defs.h" +#include #define GDB_YY_REMAP_PREFIX cpname #include "yy-remap.h" @@ -2038,7 +2039,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..579f09303c8 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -44,6 +44,7 @@ #include "run-on-main-thread.h" #include "typeprint.h" #include "inferior.h" +#include #define d_left(dc) (dc)->u.s_binary.left #define d_right(dc) (dc)->u.s_binary.right @@ -675,7 +676,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..6f52a1abe0e 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -49,6 +49,7 @@ #include #include +#include struct comp_unit; @@ -2126,7 +2127,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 2e5067efb3d..535028b1597 100644 --- a/gdb/dwarf2/read-debug-names.c +++ b/gdb/dwarf2/read-debug-names.c @@ -26,6 +26,7 @@ #include "mapped-index.h" #include "read.h" #include "stringify.h" +#include /* A description of the mapped .debug_names. Uninitialized map has CU_COUNT 0. */ @@ -462,7 +463,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 b96eaa96e23..da3bf0633fc 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -27,6 +27,7 @@ #include "gdbsupport/gdb-checked-static-cast.h" #include "mapped-index.h" #include "read.h" +#include /* When true, do not reject deprecated .gdb_index sections. */ static bool use_deprecated_index_sections = false; @@ -828,7 +829,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 d4aec19d31d..5bbf208ed5a 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -95,6 +95,7 @@ #include "split-name.h" #include "gdbsupport/parallel-for.h" #include "gdbsupport/thread-pool.h" +#include /* When == 1, print basic high level tracing messages. When > 1, be more verbose. @@ -4535,7 +4536,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 217753cf914..fc0c5bab6ed 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -302,7 +302,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..534b7a2bfa2 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -45,6 +45,7 @@ #include "gmp-utils.h" #include "rust-lang.h" #include "ada-lang.h" +#include /* The value of an invalid conversion badness. */ #define INVALID_CONVERSION 100 @@ -5833,7 +5834,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 944c9116731..d750371f917 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -63,6 +63,7 @@ #include #include #include +#include enum { @@ -1933,7 +1934,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..95f8069674c 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -23,6 +23,7 @@ #include "mi-out.h" #include +#include #include "interps.h" #include "ui-out.h" @@ -340,13 +341,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..aa02f193399 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -27,6 +27,7 @@ #include "gdbsupport/filestuff.h" #include "gdbsupport/scoped_fd.h" #include "gdbsupport/scoped_mmap.h" +#include #include @@ -468,7 +469,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 +618,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..a43fac98c43 100644 --- a/gdb/python/py-mi.c +++ b/gdb/python/py-mi.c @@ -27,6 +27,7 @@ #include "mi/mi-parse.h" #include "mi/mi-console.h" #include "mi/mi-interp.h" +#include /* A ui_out subclass that creates a Python object based on the data that is passed in. */ @@ -290,7 +291,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..f72f1400d1d 100644 --- a/gdb/python/py-varobj.c +++ b/gdb/python/py-varobj.c @@ -18,6 +18,7 @@ #include "varobj.h" #include "varobj-iter.h" #include "valprint.h" +#include /* A dynamic varobj iterator "class" for python pretty-printed varobjs. This inherits struct varobj_iter. */ @@ -170,5 +171,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/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..5e2f8b5f735 100644 --- a/gdb/unittests/parallel-for-selftests.c +++ b/gdb/unittests/parallel-for-selftests.c @@ -27,6 +27,7 @@ #include "defs.h" #include "gdbsupport/selftest.h" #include "gdbsupport/parallel-for.h" +#include #if CXX_STD_THREAD @@ -160,7 +161,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 +179,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..5d1ae343fca 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -33,6 +33,7 @@ #include "gdbarch.h" #include #include "observable.h" +#include #if HAVE_PYTHON #include "python/python.h" @@ -259,7 +260,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. */ -- 2.34.1