From patchwork Tue Jan 30 12:06:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 194107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1186666dyb; Tue, 30 Jan 2024 04:34:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcWnB2XEwkURfnKSxOLcx3eUyyoqZZH6QYNIHeDRhu5bGdLCDXgtkGyz2hT/UvP/5k9Rpe X-Received: by 2002:a0c:c98d:0:b0:68c:3e01:7dfd with SMTP id b13-20020a0cc98d000000b0068c3e017dfdmr1340514qvk.20.1706618066904; Tue, 30 Jan 2024 04:34:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706618066; cv=pass; d=google.com; s=arc-20160816; b=SY0e+CfzLH7nmPUxlnprNY7/kKW7hjX+khyX/YuA0I9XfT/WscRUWUTHV/08Ut2Ovk cWyJ/j1N9WwQXP1g3oy4NlIWOZjNQ1aAJ1Om+NuLuAkL9oUjGOqJThZYnYFR8lXfd7rs KYWyjuA1deXooamizi9x4se0m61nKAnwl3VkJJSqdiWJIavUHnqZivZTvzQT/kNZQevP 82ulerBr5Gp8U845uxjBcLXJ2182oAF2VRwzsxAV3wByWmME5oUo+Sd1ukdlxZA/3pws emJWI2wcSJLLs5KjRdtrQSkB+oBixuNHsJGpgVMiORGVz7zQ5DnB9Jhrsce5oU25IHPw ymdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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:arc-filter:dmarc-filter:delivered-to; bh=1hI5ul/nN/WJfM/4k9bug7luwoQK7BhQuffp06BUC/0=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=SGvP+a5L/owMaMOGLj0qa9XnY+VfPtfx/qaoD2IJ4eHI9LZ988RBmjXKgFsLh0Zc9j 89eqBnPu+gBCZX58lwak6Adn69eBBM1UE8uUuVv68ueTcsS3JYbO1lmVxODnPHOOPHXh 8lwh/PzTvTHSgumiTLyfpCVsawdsBPN7/BhilLTyBkIYelCOZ6JnF38BDdpmyQJ4k2CL Fe1okZgVdT9LrTy6JKsswvTFyygR0VJoau70lKxYBBMiXutzxY6hi33is7tM9nijoHQW yF6wI+Wu0tGbBJ5UVGH7fY7uJi2UiKQbJKP4WLv/AOvehAiSH5ec2yl9xAQfRuFjVvHc oLyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=WhvYiUsr; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q8-20020a05620a0d8800b00783aa61af29si10624829qkl.526.2024.01.30.04.34.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:34:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=WhvYiUsr; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 D39243831E1C for ; Tue, 30 Jan 2024 12:33:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 2CB2A3857C45 for ; Tue, 30 Jan 2024 12:11:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CB2A3857C45 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 2CB2A3857C45 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616683; cv=none; b=FTTm+eIEMczYLVt9SI/evzUtcr3wN28beOZBfK8hxbDtymI0qGBOJWx+LW7JffMAewqNPkz39wW25Qnp2hLwwcWJt1OLDoXQSbXDVJtnwrttTmAZ8gcOu1xw5Q/WMamsLZSqb1tRk2rYzcLpvCuM7BesLa2GrJG8q83MxLdzmf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616683; c=relaxed/simple; bh=1KM3XOTx+OBcvNua9Q22Alm6XZ8f/oURA1H2XudK80E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dswR/Itxc9xoZ1XSNsXt3qioH9j4JtpI83bv6X2AV2YZzMepX7BptKZ7WrMQN0IznlTfzcXOoTwjZ3lBbvGzGzlKyK2/6QeHM8qux4CqGlz9eE8uFi457fwLAdaF/Ddn8McldeyWYZc76tIF8j3j+PCkx26KleiD4k5CvmtlhJQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ae51f8111so1919809f8f.2 for ; Tue, 30 Jan 2024 04:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616672; x=1707221472; 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=1hI5ul/nN/WJfM/4k9bug7luwoQK7BhQuffp06BUC/0=; b=WhvYiUsrhiePsiVChXhEDl984fdKOLstfJtXfVCoX7IUdir7/iPKEb87w4dTj/W08O oSXFNHPxALqt4fN9GKFiEFiqIRdvpzVSxjJxaToXqLljUIaDsysrcx6UqOytD9Oi7E55 fEbMqmU2b6p7JKJ6VS0YK8t5FnS+MJk7MNXfXuqdzPUYqFZ+zYK6fL+PgLdLwfunmJ79 Pw3Ww7pXspIchyV59xqhnTQ0D1LGuKT9F0yxg20DTIHS8XgfREL13T7oTf7SW5Dh1tab JBbatIDec+bluU17c6kOb9PE1RZ7XoDgZXd3AI+Mt/CB6qfypTBe7wahKArp3z931HIM 9keg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616672; x=1707221472; 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=1hI5ul/nN/WJfM/4k9bug7luwoQK7BhQuffp06BUC/0=; b=tLvl6QUMjXryUAo+WUiWCC5/GuunA2jgeV+G+LipYKF+4YRPl58BXbi4jyDWz2wM3t 8FY5WUDIYgDT4umfGs9iaVUiOvUZijwAYa8d4HKW9VVrfW24JCqzMYc69VkPRDPXKBn0 tI0mLXHUmBg/UEYX8RxVzTbmaX2uveYz0Wim7SWXSKMNjWuBvWKR7L9ADrPdQQgpJPX7 0QHA5SLAJZy4vBjTUVwbPtYR16Z73mK4M10oyC661/yZP4l/mhNfxZFXEYvRmxQ4RLBH lSNJDf1U5o/ONPAExF+Z5doL5ms4mQjfrNWZexGCdrCXc1di7NU58lgn5UFrP0qPV1eS hJtQ== X-Gm-Message-State: AOJu0YxUtmRbuf+bjtDwD4XUI5ncAlsoCwyJyb9DIJ6A/d6CPi5t8kqR +eup9bkXlhRZaUHN7h9iT4JGoEZ9DtfEtEmXlWqK0LHjsinn9Z+ZtKXjVX+feeOfofHLLHuA5A9 Y9Q== X-Received: by 2002:adf:cd10:0:b0:33a:e52b:b70a with SMTP id w16-20020adfcd10000000b0033ae52bb70amr5674810wrm.52.1706616672281; Tue, 30 Jan 2024 04:11:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:11 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [COMMITTED 029/101] gccrs: Add a list of weak keyword Date: Tue, 30 Jan 2024 13:06:45 +0100 Message-ID: <20240130121026.807464-32-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> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 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=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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789518746039652598 X-GMAIL-MSGID: 1789518746039652598 From: Pierre-Emmanuel Patry Retrieving a weak keyword value is done using raw values. Introducing a list of weak keywords means this could change. gcc/rust/ChangeLog: * util/rust-keyword-values.h (class WeakKeywords): Add new class with weak keyword constexpr. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/util/rust-keyword-values.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/rust/util/rust-keyword-values.h b/gcc/rust/util/rust-keyword-values.h index 769b2100c41..4a6f1df525d 100644 --- a/gcc/rust/util/rust-keyword-values.h +++ b/gcc/rust/util/rust-keyword-values.h @@ -41,6 +41,20 @@ public: #undef RS_TOKEN }; +class WeakKeywords +{ +public: + static constexpr auto &AUTO = "auto"; + static constexpr auto &BUILTIN = "builtin"; + static constexpr auto &CATCH = "catch"; + static constexpr auto &DEFAULT = "default"; + static constexpr auto &GEN = "gen"; + static constexpr auto &MACRO_RULES = "macro_rules"; + static constexpr auto &RAW = "raw"; + static constexpr auto &UNION = "union"; + static constexpr auto &YEET = "yeet"; +}; + } // namespace Values } // namespace Rust