aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/rust-ast-lower-base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-base.cc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index c21f511..972d34c 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -970,5 +970,21 @@ ASTLoweringBase::lower_extern_block (AST::ExternBlock &extern_block)
return hir_extern_block;
}
+void
+ASTLoweringBase::lower_macro_definition (AST::MacroRulesDefinition &def)
+{
+ auto is_export = false;
+ for (const auto &attr : def.get_outer_attrs ())
+ if (attr.get_path ().as_string () == "macro_export")
+ is_export = true;
+
+ if (is_export)
+ {
+ mappings->insert_exported_macro (def);
+ mappings->insert_ast_item (&def);
+ mappings->insert_location (def.get_node_id (), def.get_locus ());
+ }
+}
+
} // namespace HIR
} // namespace Rust