diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-08-02 12:53:20 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:00:27 +0100 |
commit | 8ea51b5c81fd4ff602eff4ab0e526699b87dde8c (patch) | |
tree | a473c709d705a86809133d806f1cb06d42a1bdd7 | |
parent | c2ea7f6f36c48483a1a776fb51e04214d4526724 (diff) | |
download | gcc-8ea51b5c81fd4ff602eff4ab0e526699b87dde8c.zip gcc-8ea51b5c81fd4ff602eff4ab0e526699b87dde8c.tar.gz gcc-8ea51b5c81fd4ff602eff4ab0e526699b87dde8c.tar.bz2 |
gccrs: nr2.0: Add macros 2.0 in Ribs in TopLevel visitor
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Declare
macros in the current rib if they are macros 2.0.
-rw-r--r-- | gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc index 2c0e077..c28d922 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -86,7 +86,8 @@ TopLevel::visit (AST::MacroRulesDefinition ¯o) { // we do not insert macros in the current rib as that needs to be done in the // textual scope of the Early pass. we only insert them in the root of the - // crate if they are marked with #[macro_export] + // crate if they are marked with #[macro_export]. The execption to this is + // macros 2.0, which get resolved and inserted like regular items. if (is_macro_export (macro)) { @@ -103,6 +104,9 @@ TopLevel::visit (AST::MacroRulesDefinition ¯o) macro.get_rule_name ().as_string ().c_str ()); } } + + if (macro.get_kind () == AST::MacroRulesDefinition::MacroKind::DeclMacro) + insert_or_error_out (macro.get_rule_name (), macro, Namespace::Macros); } void |