aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-09-27 15:52:57 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:35 +0100
commit31150a6366dbd5b3028ffd99942d8a84081c7842 (patch)
treea3bfc84ded25a729ca5f4e9def3ee4d49aab758b /gcc
parent421494b5929fe362aa5ef99a444c8b9b700a6563 (diff)
downloadgcc-31150a6366dbd5b3028ffd99942d8a84081c7842.zip
gcc-31150a6366dbd5b3028ffd99942d8a84081c7842.tar.gz
gcc-31150a6366dbd5b3028ffd99942d8a84081c7842.tar.bz2
gccrs: dump: Dump items within modules
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index b7557bd..653c1d9 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -809,7 +809,23 @@ Dump::visit (Method &method)
void
Dump::visit (Module &module)
-{}
+{
+ indentation.increment ();
+
+ stream << indentation;
+ emit_visibility (module.get_visibility ());
+ stream << "mod" << module.get_name () << " {\n";
+
+ for (auto &item : module.get_items ())
+ {
+ stream << indentation;
+ item->accept_vis (*this);
+ stream << '\n';
+ }
+
+ indentation.decrement ();
+ stream << indentation << "}\n";
+}
void
Dump::visit (ExternCrate &crate)