aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-03-01 12:35:18 +0100
committerCohenArthur <arthur.cohen@embecosm.com>2023-03-14 16:15:50 +0000
commita1f940d193c6cdb13483690a4f4a7d501ad7040e (patch)
tree5bdb29cf2a128ae959d0b8d230d534563c487b88 /gcc/rust/resolve
parent43590461e0033ff677ba4f3bf90cd289cf0b2518 (diff)
downloadgcc-a1f940d193c6cdb13483690a4f4a7d501ad7040e.zip
gcc-a1f940d193c6cdb13483690a4f4a7d501ad7040e.tar.gz
gcc-a1f940d193c6cdb13483690a4f4a7d501ad7040e.tar.bz2
hir: Add ExportedMacro node and handling.
This HIR node represents macros which should be exported into the final Rust metadata files. Because our metadata exporter operates on the HIR, while macros are inherently tied to the AST, we need a way to propagate exported macros up until the metadata export pass on the HIR. Hence the existence of this class, whose sole purpose is to keep enough information for the metadata exporter to retrieve the original AST::MacroRulesDefinition. Handling for actually exporting these macros will come later. gcc/rust/ChangeLog: * hir/tree/rust-hir-item.h (class ExportedMacro): Add new ExportedMacro class. * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): New function. (ExportedMacro::get_locus): Likewise. (ExportedMacro::get_item_kind): Likewise. (ExportedMacro::clone_item_impl): Likewise. * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Forward declare class. * backend/rust-compile-item.h: Add visitor for ExportedMacro. * backend/rust-compile-stmt.h: Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::visit): Likewise. * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise. * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise. * checks/errors/privacy/rust-reachability.h: Likewise. * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise. * checks/errors/privacy/rust-visibility-resolver.h: Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise. * checks/errors/rust-const-checker.h: Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * checks/errors/rust-unsafe-checker.h: Likewise. * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise. * hir/rust-ast-lower-item.h: Likewise. * hir/rust-hir-dump.cc (Dump::visit): Likewise. * hir/rust-hir-dump.h: Likewise. * hir/tree/rust-hir-visitor.h: Likewise. * metadata/rust-export-metadata.cc: Likewise. * typecheck/rust-hir-type-check-item.h: Likewise. * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise. * typecheck/rust-hir-type-check-stmt.h: Likewise. * typecheck/rust-tycheck-dump.h: Likewise. * hir/tree/rust-hir.h: Add new ItemKind::MacroExport variant. * util/rust-attributes.cc: Add #[macro_export] attribute.
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions