]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Change keyword set to a map
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 8 Nov 2023 13:54:51 +0000 (14:54 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:13:13 +0000 (19:13 +0100)
commite50b0969b8eb69afd5432fc4aee1434974275067
treec34d8a03aa19a82cef6948bc2e428a69bbd7e29b
parent8f41baaa832a480338b7a4d686d4b26000164588
gccrs: Change keyword set to a map

Some part of the code requires the token id behind a given keyword, a map
keep the "set" aspect whilst providing this additional feature.

gcc/rust/ChangeLog:

* lex/rust-lex.cc (RS_TOKEN): Remove local map.
(RS_TOKEN_KEYWORD): Likewise.
(Lexer::classify_keyword): Change call to utils.
* util/rust-keyword-values.cc (get_keywords): Add init function.
(RS_TOKEN_KEYWORD): Call to X macro.
* util/rust-keyword-values.h: Change from set to a map.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/lex/rust-lex.cc
gcc/rust/util/rust-keyword-values.cc
gcc/rust/util/rust-keyword-values.h