From patchwork Wed Apr 5 14:03:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 79706 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp359137vqo; Wed, 5 Apr 2023 07:41:33 -0700 (PDT) X-Google-Smtp-Source: AKy350ZOt1a8A8vzwDnlSInqh3E57R5mBjXsTN2u4RPIIHN2EaFfn3cP4kdVnOTKoipULDDB7YXi X-Received: by 2002:aa7:d501:0:b0:502:9887:13e8 with SMTP id y1-20020aa7d501000000b00502988713e8mr2293170edq.2.1680705693575; Wed, 05 Apr 2023 07:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680705693; cv=none; d=google.com; s=arc-20160816; b=LBirFttHgqvo6fNpeO3qvJQtComPiICSUBj0vkwMPy18KsQxI9lYLX0CI5t4tqecK6 s2KXGRIw8+LO3gCMeTykqrHgSeeI707yxwdOhO7MZb/ivhtzYtU6QDYtJWATjMc60gfJ dCOmukfcFmXCDnAnJ3YTIoUvpil+9r5Q9Xo73jz56G9x5SV45rEXfFT1ljyK3MUeQDEl W/FHWELepR8Nfq6ZcwLopAh+02KO22pMjdRW39RSAVPXSVAlgW2OQ4syonNIV5rEiHpd x3jEdLclZBlb4RDXKMIUkrME1RbZO1Pix2ggigiokCwxaR2s0k6tg45bfJAwwB6ne2hG q8tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=8/xIvDtYrUqtcbhn4l7mUfHym4tc/4Xfd9TM/B/rF+0=; b=dTMQWP5LGVPmGwSNI08k3kLJFJo1FIT6fVCbEZEQtuRqqmnuSxZkvUZu+CO6q8AWed E25+ZZqUwK6403wm2w0H03m+aY5pI1MSgE7ODdWIz4zQLk4elZR+wEXT6VRwOINp+Ro8 JdBCuCOrc0o17ue8i14sNwhJQIkhPMthhgPNrdRTUNff7UHiOoEwth5tWqEtZFXVmwAu KZUkTn5BwFMGppxg9FzYGWS3BqeFBBHZLH0WO/TwZGVDt5O9cVR0aO0HHKE/lFF7P5wl OgTm/DIKLFs3YBgF0a2y3vFh1PykzAQhD1l9pAywrXynTUrJ0ZibUg+Mcx30f59Q+z2B Ay4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=L1iLi14u; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x23-20020aa7d397000000b004c461474e86si12250658edq.152.2023.04.05.07.41.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=L1iLi14u; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A401D3875DF7 for ; Wed, 5 Apr 2023 14:15:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 830DF38708F2 for ; Wed, 5 Apr 2023 14:06:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 830DF38708F2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x335.google.com with SMTP id i5-20020a05600c354500b003edd24054e0so23810283wmq.4 for ; Wed, 05 Apr 2023 07:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703560; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=8/xIvDtYrUqtcbhn4l7mUfHym4tc/4Xfd9TM/B/rF+0=; b=L1iLi14uLmMvXpxCPfwFGpEhrZTNOkiK9mMPZvaMnhopZSPoV736x7rJ/JG2kr6dTI ilAqREK9NV0F2oVhh2Tvl7BBQkLBaErgm5EopuIt1Tia2B+4qN3wmppzvjJtamvnl7NU 7C5XCrXXVebmIAHg5s60yBprkrQPuPx3i6bQwW+NNFa7I9IYkWvvD6HRJg3bSo7bKNgy m7fOnnSawQ+bLeaseXaew6Kugqvm3KIQpKiogjPlkde5OB3wPiJ+Ori0EaREvp0oLN3i dvW17gxiHC6RD6omqURcnDM785QMw/W8IDKhUInyiXBeoHMeGnTjt9Ip9zpXZMeY6Oy9 d2kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703560; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8/xIvDtYrUqtcbhn4l7mUfHym4tc/4Xfd9TM/B/rF+0=; b=g9fwjesRucYxNil5t8D1alfAib4jpcGhNLpA0lL9CGbX31lb2njGKiGZsN/Rj3awp6 HtEoK7U5jsEz6djiY5VMGEg3WWQo6ZfYYi+VRL9PF7ABdUqdWxyQSqTnjV/hpKKKqK/1 F+B5gR/nZYqC0ND9hV+XHnzVqAEmicW7zyP77aPYRZm5S8p/OqwrwDLW3iXo0rLf9x1y +HRcMYibXlohzmN2fe13AmvzL7u4eNTkPCEl8sMlJhqG/wlgnfo8k1Jmwlhcfzq+4j/z 4JRszgvBDCVHJinC9a+mxzwmFGKedBVQeTReWVZfVup96gltz9qYOsRtn+ugQHeNGF+n eYDw== X-Gm-Message-State: AAQBX9fxt0PDpC0P61DtpCaW8F4dqqjc3T9L6RuAds+woVd8KYLCdiJB K0PIqJxXVKjCY1+BlW6fazS+R9Z/rDQyU//Jmw== X-Received: by 2002:a1c:6a04:0:b0:3ee:da1:1346 with SMTP id f4-20020a1c6a04000000b003ee0da11346mr4789907wmc.36.1680703560238; Wed, 05 Apr 2023 07:06:00 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:06:00 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron Subject: [committed 45/88] gccrs: Rename header rust-hir-trait-ref.h to rust-hir-trait-reference.h Date: Wed, 5 Apr 2023 16:03:29 +0200 Message-Id: <20230405140411.3016563-46-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405140411.3016563-1-arthur.cohen@embecosm.com> References: <20230405140411.3016563-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762347652963718626?= X-GMAIL-MSGID: =?utf-8?q?1762347652963718626?= From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-trait-ref.h: Moved to... * typecheck/rust-hir-trait-reference.h: ...here. * typecheck/rust-hir-trait-resolve.cc: refactor * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise * typecheck/rust-hir-type-check.h: likewise * typecheck/rust-tyty.cc: likewise --- ...rust-hir-trait-ref.h => rust-hir-trait-reference.h} | 0 gcc/rust/typecheck/rust-hir-trait-resolve.cc | 10 ++++++++++ gcc/rust/typecheck/rust-hir-trait-resolve.h | 9 +-------- gcc/rust/typecheck/rust-hir-type-check.h | 2 +- gcc/rust/typecheck/rust-tyty.cc | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) rename gcc/rust/typecheck/{rust-hir-trait-ref.h => rust-hir-trait-reference.h} (100%) diff --git a/gcc/rust/typecheck/rust-hir-trait-ref.h b/gcc/rust/typecheck/rust-hir-trait-reference.h similarity index 100% rename from gcc/rust/typecheck/rust-hir-trait-ref.h rename to gcc/rust/typecheck/rust-hir-trait-reference.h diff --git a/gcc/rust/typecheck/rust-hir-trait-resolve.cc b/gcc/rust/typecheck/rust-hir-trait-resolve.cc index 19f95ca4488..e2d0cf2d7a2 100644 --- a/gcc/rust/typecheck/rust-hir-trait-resolve.cc +++ b/gcc/rust/typecheck/rust-hir-trait-resolve.cc @@ -22,6 +22,16 @@ namespace Rust { namespace Resolver { +TraitItemReference +ResolveTraitItemToRef::Resolve ( + HIR::TraitItem &item, TyTy::BaseType *self, + std::vector substitutions) +{ + ResolveTraitItemToRef resolver (self, std::move (substitutions)); + item.accept_vis (resolver); + return std::move (resolver.resolved); +} + void ResolveTraitItemToRef::visit (HIR::TraitItemType &type) { diff --git a/gcc/rust/typecheck/rust-hir-trait-resolve.h b/gcc/rust/typecheck/rust-hir-trait-resolve.h index ca23d48c3dd..da8e2c0b838 100644 --- a/gcc/rust/typecheck/rust-hir-trait-resolve.h +++ b/gcc/rust/typecheck/rust-hir-trait-resolve.h @@ -19,9 +19,7 @@ #ifndef RUST_HIR_TRAIT_RESOLVE_H #define RUST_HIR_TRAIT_RESOLVE_H -#include "rust-hir-type-check-base.h" #include "rust-hir-type-check-type.h" -#include "rust-hir-trait-ref.h" namespace Rust { namespace Resolver { @@ -32,12 +30,7 @@ class ResolveTraitItemToRef : public TypeCheckBase, public: static TraitItemReference Resolve (HIR::TraitItem &item, TyTy::BaseType *self, - std::vector substitutions) - { - ResolveTraitItemToRef resolver (self, std::move (substitutions)); - item.accept_vis (resolver); - return std::move (resolver.resolved); - } + std::vector substitutions); void visit (HIR::TraitItemType &type) override; diff --git a/gcc/rust/typecheck/rust-hir-type-check.h b/gcc/rust/typecheck/rust-hir-type-check.h index d1eb750a621..512453947a6 100644 --- a/gcc/rust/typecheck/rust-hir-type-check.h +++ b/gcc/rust/typecheck/rust-hir-type-check.h @@ -22,7 +22,7 @@ #include "rust-hir-full-decls.h" #include "rust-hir-map.h" #include "rust-tyty.h" -#include "rust-hir-trait-ref.h" +#include "rust-hir-trait-reference.h" #include "rust-autoderef.h" namespace Rust { diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 61c02a85c53..4c324c66c16 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -27,7 +27,7 @@ #include "rust-linemap.h" #include "rust-substitution-mapper.h" -#include "rust-hir-trait-ref.h" +#include "rust-hir-trait-reference.h" #include "rust-hir-type-bounds.h" #include "rust-hir-trait-resolve.h" #include "rust-tyty-rules.h"