summaryrefslogtreecommitdiff
path: root/src/trans/codegen.cpp
diff options
context:
space:
mode:
authorJohn Hodge (Mutabah) <acessdev@gmail.com>2018-02-11 15:33:08 +0800
committerGitHub <noreply@github.com>2018-02-11 15:33:08 +0800
commit6caf5739a97774b2602106e616db75e8a0ad5f8a (patch)
tree9d16f869bbff27743fe7c233fba9c4665a4d9138 /src/trans/codegen.cpp
parent9e864a5d3ea05706ea6c7f68e47d32629a2c877e (diff)
parent3718f8cb7ee7b8c93e4d69b9aa2e00b4f50efd62 (diff)
downloadmrust-6caf5739a97774b2602106e616db75e8a0ad5f8a.tar.gz
Merge pull request #52 from thepowersgang/common_layout
Merge "common_layout" branch
Diffstat (limited to 'src/trans/codegen.cpp')
-rw-r--r--src/trans/codegen.cpp11
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.