diff options
author | John Hodge <tpg@mutabah.net> | 2018-01-27 16:02:21 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-01-27 16:02:21 +0800 |
commit | aeaeba5490d83937f647b544603c4da3b5c11dd4 (patch) | |
tree | 95c92e0b4f3dfdde16f67627601c1a9e46912435 /src/trans/codegen.cpp | |
parent | 11d1bc911f80ed81ee4c96c8c1157d60d889d4d2 (diff) | |
download | mrust-aeaeba5490d83937f647b544603c4da3b5c11dd4.tar.gz |
Trans - Add "backend" for monomorphised MIR
Diffstat (limited to 'src/trans/codegen.cpp')
-rw-r--r-- | src/trans/codegen.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/trans/codegen.cpp b/src/trans/codegen.cpp index b3244072..f008a2b3 100644 --- a/src/trans/codegen.cpp +++ b/src/trans/codegen.cpp @@ -18,7 +18,16 @@ void Trans_Codegen(const ::std::string& outfile, const TransOptions& opt, const ::HIR::Crate& crate, const TransList& list, bool is_executable) { static Span sp; - auto codegen = Trans_Codegen_GetGeneratorC(crate, outfile); + ::std::unique_ptr<CodeGenerator> codegen; + + if( opt.mode == "monomir" ) + { + codegen = Trans_Codegen_GetGenerator_MonoMir(crate, outfile); + } + else + { + codegen = Trans_Codegen_GetGeneratorC(crate, outfile); + } // 1. Emit structure/type definitions. // - Emit in the order they're needed. |