From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3A4A73857B88 for ; Wed, 26 Oct 2022 20:57:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A4A73857B88 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666817822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7to/i1J1sqpQ0CBT3p4VWxEZ/ET7JYwCdRKd/hSGJDk=; b=XS3Zpc/Z32DPPynGlSpOf0vS1hubY7B1ga1p0ts72ISYMujvaBtpskf25SzYmM/Qoeh5bY M/4LcuSYa7V6W1S9ohgXrho2vUWs26/4KZFcME5Z/CADx9U/9hATZODsrtsjqISr/CHezi fa0ysMJUYUyh5HXJGa4bKeAKjqTo0wA= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-612-8EOwtAwkMbqRQLPDNU6GsA-1; Wed, 26 Oct 2022 16:57:01 -0400 X-MC-Unique: 8EOwtAwkMbqRQLPDNU6GsA-1 Received: by mail-qt1-f200.google.com with SMTP id fz10-20020a05622a5a8a00b003a4f466998cso1286682qtb.16 for ; Wed, 26 Oct 2022 13:57:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7to/i1J1sqpQ0CBT3p4VWxEZ/ET7JYwCdRKd/hSGJDk=; b=w7p6p8uD/ZiDC0GMsLbhgLCpYeruqTjj7VTR8ilk1uM+BKPZQhx4SerSsKgyqmlPOa l5nUTiqtpTTW34ZJhtDqd98uoVSIPouKr47amLKJcmUWKFKPPL8a0rNyUdtBcaVAsFO4 WLT+dbsAPt/djRBI+BQLf3hMJCG17l0xYOaLT63+dXrJLhm7Oi87dmyZEt73pHJD4Kp1 x8cUZaWmFJCZZm7afWXaGQRwHfNo9qYkE/5/YHbKMfLVIEAAjQExLWQDcD369gMR2b9A fkO1RYsuBK5cgQpvw2X5j1BLiqNpLJcpbVd2WNGrGBv/rAUfgKeGi7ESPi/SQVRFL/qv 8gmw== X-Gm-Message-State: ACrzQf0/a+nkj1dCHjRErGB0/YyGhaLyjfQI+mC9wa7KXOP+E//WhjJP qCaIXHjZiNCvzuOz9Uprs1ctuuccC5Hl0hyPwH4g04RZyOO0KxZKgFMuFCTiUbo6kBoO883atBw z/tu5Oa96FeP6QQ== X-Received: by 2002:a05:620a:294f:b0:6cf:920e:4f3a with SMTP id n15-20020a05620a294f00b006cf920e4f3amr32097957qkp.66.1666817821187; Wed, 26 Oct 2022 13:57:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kiRmhk/bx7pcI6KwJ6edWhuIUGdu+J62OM8grqt6xttfinjX7DJ6OBRXZoze7qSrkGC1XOw== X-Received: by 2002:a05:620a:294f:b0:6cf:920e:4f3a with SMTP id n15-20020a05620a294f00b006cf920e4f3amr32097950qkp.66.1666817820912; Wed, 26 Oct 2022 13:57:00 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.nh.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id w14-20020ac87e8e000000b003a4b88b886esm2534091qtj.96.2022.10.26.13.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 13:56:59 -0700 (PDT) Message-ID: <57313d59d28382060b612554d3e5b7b24ac375a2.camel@redhat.com> Subject: Re: [PATCH Rust front-end v3 20/46] gccrs: Add wrapper for make_unique From: David Malcolm To: arthur.cohen@embecosm.com, gcc-patches@gcc.gnu.org, Jonathan Wakely Cc: gcc-rust@gcc.gnu.org Date: Wed, 26 Oct 2022 16:56:59 -0400 In-Reply-To: <20221026081811.602573-21-arthur.cohen@embecosm.com> References: <20221026081811.602573-1-arthur.cohen@embecosm.com> <20221026081811.602573-21-arthur.cohen@embecosm.com> User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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: On Wed, 2022-10-26 at 10:17 +0200, arthur.cohen@embecosm.com wrote: > From: Philip Herron >=20 > This is a wrapper for make_unique we can likely get rid of this as > there > are other implementations available or simply keep using the > unique_ptr > constructor. [CCing Jonathan] As it happens, I just posted something similar here for review: [PATCH v3] Add gcc/make-unique.h https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604442.html which I hope to use in many places in the analyzer. Dave > --- > =C2=A0gcc/rust/util/rust-make-unique.h | 35 > ++++++++++++++++++++++++++++++++ > =C2=A01 file changed, 35 insertions(+) > =C2=A0create mode 100644 gcc/rust/util/rust-make-unique.h >=20 > diff --git a/gcc/rust/util/rust-make-unique.h b/gcc/rust/util/rust- > make-unique.h > new file mode 100644 > index 00000000000..7b79e625ff1 > --- /dev/null > +++ b/gcc/rust/util/rust-make-unique.h > @@ -0,0 +1,35 @@ > +// Copyright (C) 2020-2022 Free Software Foundation, Inc. > + > +// This file is part of GCC. > + > +// GCC is free software; you can redistribute it and/or modify it > under > +// the terms of the GNU General Public License as published by the > Free > +// Software Foundation; either version 3, or (at your option) any > later > +// version. > + > +// GCC is distributed in the hope that it will be useful, but > WITHOUT ANY > +// WARRANTY; without even the implied warranty of MERCHANTABILITY or > +// FITNESS FOR A PARTICULAR PURPOSE.=C2=A0 See the GNU General Public > License > +// for more details. > + > +// You should have received a copy of the GNU General Public License > +// along with GCC; see the file COPYING3.=C2=A0 If not see > +// . > + > +#ifndef RUST_MAKE_UNIQUE_H > +#define RUST_MAKE_UNIQUE_H > + > +#include "rust-system.h" > + > +namespace Rust { > + > +template > +std::unique_ptr > +make_unique (Ts &&...params) > +{ > +=C2=A0 return std::unique_ptr (new T (std::forward (params)...)); > +} > + > +} // namespace Rust > + > +#endif // RUST_MAKE_UNIQUE_H