diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-20 13:04:48 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-20 13:04:48 +0800 |
commit | d9a88049e0ab150657253ce2f0a6fffe96ffddef (patch) | |
tree | 686da7b5eb03ce05ca1da748f8012595ac49270c /src/main.cpp | |
parent | 7b33b33226d0b1106e7fe9701fefad45027617c0 (diff) | |
download | mrust-d9a88049e0ab150657253ce2f0a6fffe96ffddef.tar.gz |
HIR Dump - Initial support, verbose but complete
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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 <cstring>
#include <main_bindings.hpp>
#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)
|