]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
Dump inner attrs for Dump::visit(BlockExpr &)
authorJiakun Fan <120090316@link.cuhk.edu.cn>
Sat, 11 Mar 2023 17:47:32 +0000 (17:47 +0000)
committerPhilip Herron <philip.herron@embecosm.com>
Fri, 17 Mar 2023 16:38:54 +0000 (16:38 +0000)
Refer to `BlockExpr::as_string ()`, dump inner attrs for `Dump::vist`

gcc/rust/ChangeLog:

* hir/rust-hir-dump.cc (Dump::visit):
dump inner attrs

Signed-off-by: Jiakun Fan <120090316@link.cuhk.edu.cn>
gcc/rust/hir/rust-hir-dump.cc

index 694a809aa44ff7ed1b8e242967261248e7fa58a7..f2df4a0da707f836b97b17f90dcbe30aecbcce02 100644 (file)
@@ -238,7 +238,22 @@ Dump::visit (BlockExpr &block_expr)
   stream << "BlockExpr: [";
   indentation.increment ();
   stream << std::endl;
+
   // TODO: inner attributes
+  stream << std::string (indent, indent_char);
+  stream << "inner attributes: ";
+  if (!block_expr.inner_attrs.empty ())
+    {
+      for (const auto &attr : block_expr.inner_attrs)
+       {
+         stream << std::endl;
+         stream << std::string (indent, indent_char);
+         stream << attr.as_string ();
+         // stream << attr.accept_vis(*self);
+       }
+    }
+
+  stream << std::endl;
 
   // statements
   if (block_expr.has_statements ())