summaryrefslogtreecommitdiff
path: root/src/trans/monomorphise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trans/monomorphise.cpp')
-rw-r--r--src/trans/monomorphise.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/trans/monomorphise.cpp b/src/trans/monomorphise.cpp
index 1688a8f5..3ac2ee09 100644
--- a/src/trans/monomorphise.cpp
+++ b/src/trans/monomorphise.cpp
@@ -150,6 +150,9 @@ namespace {
case ::MIR::Statement::TAG_SetDropFlag:
statements.push_back( ::MIR::Statement( stmt.as_SetDropFlag() ) );
break;
+ case ::MIR::Statement::TAG_ScopeEnd:
+ statements.push_back( ::MIR::Statement( stmt.as_ScopeEnd() ) );
+ break;
case ::MIR::Statement::TAG_Drop: {
const auto& e = stmt.as_Drop();
DEBUG("- DROP " << e.slot);
@@ -249,9 +252,21 @@ namespace {
mv$(rval)
}) );
} break;
- case ::MIR::Statement::TAG_Asm:
- TODO(params.sp, "Monormorphise asm!");
- break;
+ case ::MIR::Statement::TAG_Asm: {
+ const auto& e = stmt.as_Asm();
+ DEBUG("- asm! \"" << e.tpl << "\"");
+ ::std::vector< ::std::pair<::std::string, ::MIR::LValue>> new_out, new_in;
+ new_out.reserve( e.outputs.size() );
+ for(auto& ent : e.outputs)
+ new_out.push_back(::std::make_pair( ent.first, monomorph_LValue(resolve, params, ent.second) ));
+ new_in.reserve( e.inputs.size() );
+ for(auto& ent : e.inputs)
+ new_in.push_back(::std::make_pair( ent.first, monomorph_LValue(resolve, params, ent.second) ));
+
+ statements.push_back( ::MIR::Statement::make_Asm({
+ e.tpl, mv$(new_out), mv$(new_in), e.clobbers, e.flags
+ }) );
+ } break;
}
}