aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-gcc.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-05-03 11:19:30 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:34:17 +0100
commitcf1287ee24c5c83b38737c50e3cd37ab62f3d279 (patch)
treef0dba879502610feb775a4901c72924786dba8cf /gcc/rust/rust-gcc.cc
parent25c9921b1d9bd2c508c1ac3c89e2e192a17b6f8b (diff)
downloadgcc-cf1287ee24c5c83b38737c50e3cd37ab62f3d279.zip
gcc-cf1287ee24c5c83b38737c50e3cd37ab62f3d279.tar.gz
gcc-cf1287ee24c5c83b38737c50e3cd37ab62f3d279.tar.bz2
gccrs: builtin: Cleanup handling of builtin macros
This commit regroups information related to builtin macros in one place instead of spreading it over multiple files. It also adds a simple bi-directional hashmap in order to perform lookups from a key as well as a value. gcc/rust/ChangeLog: * ast/rust-macro.cc (builtin_macro_from_string): Move function. * ast/rust-macro.h (enum class): Move enum. (builtin_macro_from_string): Move function. * expand/rust-macro-builtins.cc (builtin_macro_from_string): New function. (make_macro_path_str): Use new bi-map. (parse_single_string_literal): Use new `BuiltinMacro` enum. (MacroBuiltin::include_bytes_handler): Likewise. (MacroBuiltin::include_str_handler): Likewise. (MacroBuiltin::compile_error_handler): Likewise. (MacroBuiltin::concat_handler): Likewise. (MacroBuiltin::env_handler): Likewise. (MacroBuiltin::include_handler): Likewise. (MacroBuiltin::sorry): New function. * expand/rust-macro-builtins.h (enum class): Move enum here. (builtin_macro_from_string): New function declaration. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Use new function. * util/rust-hir-map.cc (Mappings::insert_macro_def): Remove old builtin macro map.
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
0 files changed, 0 insertions, 0 deletions