From d9a88049e0ab150657253ce2f0a6fffe96ffddef Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 20 Aug 2016 13:04:48 +0800 Subject: HIR Dump - Initial support, verbose but complete --- src/main.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 36e1b191..33d81473 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include #include #include "resolve/main_bindings.hpp" +#include "hir/main_bindings.hpp" #include "hir_conv/main_bindings.hpp" #include "hir_typeck/main_bindings.hpp" #include "hir_expand/main_bindings.hpp" @@ -219,6 +220,11 @@ int main(int argc, char *argv[]) Typecheck_Expressions_Validate(*hir_crate); }); + CompilePhaseV("Dump HIR", [&]() { + ::std::ofstream os (FMT(params.outfile << "_3_hir.rs")); + HIR_Dump( os, *hir_crate ); + }); + if( params.last_stage == ProgramParams::STAGE_TYPECK ) { return 0; } @@ -228,12 +234,12 @@ int main(int argc, char *argv[]) HIR_GenerateMIR(*hir_crate); }); - // Flatten modules into "mangled" set - //g_cur_phase = "Flatten"; - //AST::Flat flat_crate = Convert_Flatten(crate); + // Validate the MIR + // TODO: ^ + + // Generate code for non-generic public items (if requested) - // Convert structures to C structures / tagged enums - //Convert_Render(flat_crate, stdout); + // Save HIR tree (if requested) } catch(unsigned int) {} //catch(const CompileError::Base& e) -- cgit v1.2.3