[gcc r14-7677] gccrs: Print macro invocations in AST dump

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 17:52:56 GMT 2024


https://gcc.gnu.org/g:e302a55c6a71de29e1d1d4e503490f28198eb59c

commit r14-7677-ge302a55c6a71de29e1d1d4e503490f28198eb59c
Author: Matthew Jasper <mjjasper1@gmail.com>
Date:   Sat Jun 3 13:37:51 2023 +0100

    gccrs: Print macro invocations in AST dump
    
    gcc/rust/ChangeLog:
    
            * ast/rust-ast-dump.cc (Dump::visit): Print macro invocations.
    
    Signed-off-by: Matthew Jasper <mjjasper1@gmail.com>

Diff:
---
 gcc/rust/ast/rust-ast-dump.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index d486b1deb8b..8cd99fcc17d 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -1570,8 +1570,11 @@ Dump::visit (MacroRulesDefinition &rules_def)
 }
 
 void
-Dump::visit (MacroInvocation &)
-{}
+Dump::visit (MacroInvocation &invocation)
+{
+  // FIXME: make this accurately reflect the original macro syntax.
+  stream << invocation.get_invoc_data ().as_string ();
+}
 
 void
 Dump::visit (MetaItemPath &)


More information about the Gcc-cvs mailing list