-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expand: Keep track of semicoloned builtin macros
This is quite a rough fix (like a lot of the macro expansion code...) but it allows built-in macros to be treated as statements. I *think* asm!() might be the only one where it really matters, but also doing something like { line!(); } will now work, whereas before the macro invocation would not get expanded properly and would be ignored. gcc/rust/ChangeLog: * ast/rust-ast-fragment.h: Pass `is_semicolon` information to builtin macro transcribers. * ast/rust-macro.h: Pass semicolon information to transcriber.. * 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. (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_invoc): Likewise. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Remove rust_unreachable. * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise. * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
- Loading branch information
1 parent
89c056b
commit fb906a4
Showing
15 changed files
with
94 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.