From be0892fb5cd1442013ee9e761e60294a374f4566 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 21 May 2016 12:06:53 +0800 Subject: Main - Some planning --- src/main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index fd6cd692..b223c534 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,6 +135,10 @@ int main(int argc, char *argv[]) CompilePhaseV("Temp output - Resolved", [&]() { Dump_Rust( FMT(params.outfile << "_1_res.rs").c_str(), crate ); }); + + if( params.last_stage == ProgramParams::STAGE_RESOLVE ) { + return 0; + } ::HIR::CratePtr hir_crate; CompilePhaseV("HIR Lower", [&]() { @@ -144,7 +148,7 @@ int main(int argc, char *argv[]) // Perform type checking on items // - Replace type aliases (`type`) into the actual type CompilePhaseV("Resolve Type Aliases", [&]() { - //Typecheck_ExpandAliases(hir_crate); + //ConvertHIR_ExpandAliases(hir_crate); }); // Typecheck / type propagate module (type annotations of all values) // - Check all generic conditions (ensure referenced trait is valid) @@ -160,14 +164,18 @@ int main(int argc, char *argv[]) CompilePhaseV("TypecheckExpr", [&]() { //Typecheck_Expr(crate); }); + + if( params.last_stage == ProgramParams::STAGE_TYPECK ) { + return 0; + } // Expand closures into items CompilePhaseV("Lower Closures", [&]() { - // + //ConvertHIR_Closures(hir_crate); }); // Lower expressions into MIR CompilePhaseV("Lower MIR", [&]() { - // + //ConvertHIR_MIR(hir_crate); }); CompilePhaseV("Output", [&]() { -- cgit v1.2.3