diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-06-18 13:47:57 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-06-18 12:24:32 +0000 |
commit | 7d22e900b069c5acdff8272da89b959c50dcb666 (patch) | |
tree | f8fe54ff3039a6171bc3100bfeff287ae8052e3b /gcc/rust/expand/rust-macro-builtins.h | |
parent | fb906a41a4e911f7f0d7b506347286c7d942995e (diff) | |
download | gcc-7d22e900b069c5acdff8272da89b959c50dcb666.zip gcc-7d22e900b069c5acdff8272da89b959c50dcb666.tar.gz gcc-7d22e900b069c5acdff8272da89b959c50dcb666.tar.bz2 |
expand: Switch semicolon boolean to an enum instead.
gcc/rust/ChangeLog:
* ast/rust-ast-fragment.h (enum class): Add InvocKind and AsmKind enums.
* ast/rust-macro.h: Switch semicolon boolean to InvocKind enum.
* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
* expand/rust-macro-builtins-asm.cc (MacroBuiltin::asm_handler): Likewise.
(parse_asm): Likewise.
* expand/rust-macro-builtins-asm.h (parse_asm): Likewise.
* expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler): Likewise.
* expand/rust-macro-builtins-include.cc (MacroBuiltin::include_bytes_handler): Likewise.
(MacroBuiltin::include_str_handler): Likewise.
(MacroBuiltin::include_handler): Likewise.
* expand/rust-macro-builtins-location.cc (MacroBuiltin::file_handler): Likewise.
(MacroBuiltin::column_handler): Likewise.
(MacroBuiltin::line_handler): Likewise.
* expand/rust-macro-builtins-log-debug.cc (MacroBuiltin::assert_handler): Likewise.
* expand/rust-macro-builtins-utility.cc (MacroBuiltin::compile_error_handler): Likewise.
(MacroBuiltin::concat_handler): Likewise.
(MacroBuiltin::env_handler): Likewise.
(MacroBuiltin::cfg_handler): Likewise.
(MacroBuiltin::stringify_handler): Likewise.
* expand/rust-macro-builtins.cc (format_args_maker): Likewise.
(enum class): Likewise.
(inline_asm_maker): Likewise.
(MacroBuiltin::sorry): Likewise.
(MacroBuiltin::proc_macro_builtin): Likewise.
* expand/rust-macro-builtins.h: Likewise.
* expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
(MacroExpander::expand_eager_invocations): Likewise.
(MacroExpander::expand_invoc): Likewise.
* expand/rust-macro-expand.h (struct MacroExpander): Likewise.
Diffstat (limited to 'gcc/rust/expand/rust-macro-builtins.h')
-rw-r--r-- | gcc/rust/expand/rust-macro-builtins.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins.h b/gcc/rust/expand/rust-macro-builtins.h index 448fe21..b0c4a64 100644 --- a/gcc/rust/expand/rust-macro-builtins.h +++ b/gcc/rust/expand/rust-macro-builtins.h @@ -125,68 +125,69 @@ public: static tl::optional<AST::Fragment> assert_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> file_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> column_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> include_bytes_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> include_str_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> stringify_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> compile_error_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> concat_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> env_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> cfg_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> include_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> line_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon); + AST::InvocKind semicolon); static tl::optional<AST::Fragment> asm_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon, - bool is_global_asm); + AST::InvocKind semicolon, + AST::AsmKind is_global_asm); static tl::optional<AST::Fragment> format_args_handler (location_t invoc_locus, AST::MacroInvocData &invoc, - bool semicolon, AST::FormatArgs::Newline nl); + AST::InvocKind semicolon, AST::FormatArgs::Newline nl); - static tl::optional<AST::Fragment> - sorry (location_t invoc_locus, AST::MacroInvocData &invoc, bool semicolon); + static tl::optional<AST::Fragment> sorry (location_t invoc_locus, + AST::MacroInvocData &invoc, + AST::InvocKind semicolon); /* Builtin procedural macros do not work directly on tokens, but still need a * builtin transcriber to be considered proper builtin macros */ static tl::optional<AST::Fragment> - proc_macro_builtin (location_t, AST::MacroInvocData &, bool); + proc_macro_builtin (location_t, AST::MacroInvocData &, AST::InvocKind); }; } // namespace Rust |