[COMMITTED,029/101] gccrs: Add a list of weak keyword

Message ID 20240130121026.807464-32-arthur.cohen@embecosm.com
State Unresolved
Headers
Series [COMMITTED,001/101] gccrs: Add visibility to trait item |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Arthur Cohen Jan. 30, 2024, 12:06 p.m. UTC
  From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

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 <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/util/rust-keyword-values.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Patch

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