summaryrefslogtreecommitdiff
path: root/src/trans/codegen.cpp
diff options
context:
space:
mode:
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.