From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 879A63857C55 for ; Tue, 30 Jan 2024 12:11:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 879A63857C55 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 879A63857C55 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616702; cv=none; b=cmSDA6CzPHQIcx+tCOI6wUO+V5ssP1/N2/2RZLQl9hGNDrTn3RtDoxxKbHfLB8ugftz43bc3PXeIX3rMkr0XCxbHnk6v738nYnQD4A8+14dvDBobRA0pA/bNCLIVMigkhFEKrJk8Qm3twJHDTQuT6IJBED/5N7vlnnsmd/HDUzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616702; c=relaxed/simple; bh=PmfPeuH5NLplIoxJAssKVKIrciuumXAtRat8e7zWGAg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Nyst9H44ACzZq8oBcqXYLBAusSLftboJxf79IfqYMFNXNi6NAeNZZ6evuKHUzLg+2JL6D6PAx1Ji+/YvTYxMEZUI/Hrm6PwVw/OVjezwZEOS7Nrf/m0b+GMh8Y7lEY5JmGlVK3KPBVfrqkzq8r/30+TYyZwL8tIPUGDA/kcVrEg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40f021d3f00so4794415e9.0 for ; Tue, 30 Jan 2024 04:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616681; x=1707221481; darn=gcc.gnu.org; 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=RSKeSm8i2kDsD+WvFTdI1bJdiVZWWv27HP1DXec1GVI=; b=FDlzqANLVdOwwSP6ioEZ8XN3dz1HezGuJQYOkNvZihNKRh/3JYxSbBTBGR4MAdcMy6 /SRHVuhrOtfApDZTlQMiYpnLJkK3vfOS9x+Oy2qHdFukG1WkFJbmFkyiXlim+3HbIRgG /2hhmJ7e+9D6ChY5MdtNlTcD9iTv5H3eozx7dPcMCfAneQ2PWp35Ac6kskTjvRUWqSAg 6gf576qt8f2Jo8CTBq0xmuPPFv4kSG4IktDG/dow89nieoigk+Uo2I0PU2yUPl1j+r/g VLzjNRq2tHVPHC/tMlR+SggAY3yEWsGV3TR0Av+EtiIlxt1NnEnarTV07U34mEbx/MpO 3bMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616681; x=1707221481; 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=RSKeSm8i2kDsD+WvFTdI1bJdiVZWWv27HP1DXec1GVI=; b=UyUaffSXTdFOhmYlcDwUzb4bS0Z9feYCdUTgpqkUS+fW1vM9w+6LM2t2GdGrHMk+9F PwTXRMyzoSbQaWarC+P0NzQwDuM7SQXNrQsvwhH2W3ta4UQGj0eSDZaPKg51nFU4oWJS lQCWTbArVhqMapN8M21SqFWJEB9qfKejEZrYiVx1nzON7CyCwtNFxSgcDY0EcVB05Rjn 7easLM6lCE81skj3CLfoVM5AjeysHZ9kwEky1DlEiQL2dImAiVz0YkSt735BV9lmTXzg Zn2/+flrAfkTzHiG16f4c1WJiLkRmJUf5MiUaeFohY1W0K3FxZQDlh3YVR73NP+i0rEo gtrA== X-Gm-Message-State: AOJu0Yxds1xVqa8RC+AiK7hdVBtCWDwnx7H6Kkp6BFrLzzkfbAURJEz7 s1+kK8+zH8OCJIr3D7Zkyk1ezid+uLRljsBonK0j71tdahjuHPv6F8cRCE1BWg== X-Google-Smtp-Source: AGHT+IGuXnGsvoZT6hgqMV/OpGkVL0WXD6VTAFDfhKF43yXozKScTh/En4N+uqaOMBJAqNw34JaRLg== X-Received: by 2002:a05:600c:3547:b0:40e:f5d0:8517 with SMTP id i7-20020a05600c354700b0040ef5d08517mr4938948wmq.33.1706616681040; Tue, 30 Jan 2024 04:11:21 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:20 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [COMMITTED 041/101] gccrs: ast: Add NodeId to UseTree base class Date: Tue, 30 Jan 2024 13:06:57 +0100 Message-ID: <20240130121026.807464-44-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.2 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,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 List-Id: From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-item.h (class UseTree): Add `node_id` member. --- gcc/rust/ast/rust-item.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 2c0e45962ce..3480d126bc0 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -940,6 +940,7 @@ protected: class UseTree { location_t locus; + NodeId node_id; public: enum Kind @@ -975,6 +976,7 @@ public: virtual Kind get_kind () const = 0; location_t get_locus () const { return locus; } + NodeId get_node_id () const { return node_id; } virtual void accept_vis (ASTVisitor &vis) = 0; @@ -982,7 +984,9 @@ protected: // Clone function implementation as pure virtual method virtual UseTree *clone_use_tree_impl () const = 0; - UseTree (location_t locus) : locus (locus) {} + UseTree (location_t locus) + : locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ()) + {} }; // Use tree with a glob (wildcard) operator @@ -1182,7 +1186,7 @@ public: Kind get_kind () const override { return Rebind; } - SimplePath get_path () const + const SimplePath &get_path () const { rust_assert (has_path ()); return path; -- 2.42.1