diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-12-10 20:53:26 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2020-12-10 20:53:26 +0800 |
commit | e21c9fe1657303605efeacd4890430e7d40c4c3c (patch) | |
tree | f8d3b2df34664d4df8a3262ebe99bfde92056669 /gcc/rust/rust-session-manager.cc | |
parent | 4232e46d87feb91749edb944681d0d4b93475c3a (diff) | |
download | gcc-e21c9fe1657303605efeacd4890430e7d40c4c3c.zip gcc-e21c9fe1657303605efeacd4890430e7d40c4c3c.tar.gz gcc-e21c9fe1657303605efeacd4890430e7d40c4c3c.tar.bz2 |
Enhanced dumping of expansion
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 3e573a6..da50948 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -344,8 +344,8 @@ Session::enable_dump (std::string arg) if (arg == "all") { rust_error_at (Location (), - "dumping all is not supported as of now. choose %<lex%>, " - "%<parse%>, or %<target_options%>"); + "dumping all is not supported as of now. choose %<lex%>, %<parse%>, " + "or %<target_options%>"); return false; } else if (arg == "lex") @@ -390,8 +390,8 @@ Session::enable_dump (std::string arg) else { rust_error_at (Location (), - "dump option %qs was unrecognised. choose %<lex%>, " - "%<parse%>, or %<target_options%>", + "dump option %qs was unrecognised. choose %<lex%>, %<parse%>, or " + "%<target_options%>", arg.c_str ()); return false; } @@ -472,7 +472,6 @@ Session::parse_file (const char *filename) if (options.dump_option == CompileOptions::REGISTER_PLUGINS_DUMP) { // TODO: what do I dump here? - return; } // injection pipeline stage @@ -482,7 +481,6 @@ Session::parse_file (const char *filename) if (options.dump_option == CompileOptions::INJECTION_DUMP) { // TODO: what do I dump here? injected crate names? - return; } // expansion pipeline stage @@ -491,8 +489,10 @@ Session::parse_file (const char *filename) if (options.dump_option == CompileOptions::EXPANSION_DUMP) { - // TODO: what do I dump here? expanded macros? AST with expanded macros? - return; + // dump AST with expanded stuff + fprintf (stderr, "BEGIN POST-EXPANSION AST DUMP\n"); + parser.debug_dump_ast_output (parsed_crate); + fprintf (stderr, "END POST-EXPANSION AST DUMP\n"); } // resolution pipeline stage @@ -502,7 +502,6 @@ Session::parse_file (const char *filename) if (options.dump_option == CompileOptions::RESOLUTION_DUMP) { // TODO: what do I dump here? resolved names? AST with resolved names? - return; } if (saw_errors ()) |