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.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/trans/monomorphise.cpp b/src/trans/monomorphise.cpp
index 1a7d8e79..3ac2ee09 100644
--- a/src/trans/monomorphise.cpp
+++ b/src/trans/monomorphise.cpp
@@ -252,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;
}
}