diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-25 17:35:00 +1100 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-25 17:35:00 +1100 |
commit | 69537686be13f6ff84ce79e84374351e943ab21b (patch) | |
tree | de4bef9b5ace623b59751447b9131046483d2388 /src/trans/monomorphise.cpp | |
parent | 27b0292ca6828eed7e782a57ad4d641f0ebf7357 (diff) | |
parent | 753a2f44cc4c00b952cddae2ceed066ebb18a470 (diff) | |
download | mrust-69537686be13f6ff84ce79e84374351e943ab21b.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/trans/monomorphise.cpp')
-rw-r--r-- | src/trans/monomorphise.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/trans/monomorphise.cpp b/src/trans/monomorphise.cpp index d129eae9..03623855 100644 --- a/src/trans/monomorphise.cpp +++ b/src/trans/monomorphise.cpp @@ -60,9 +60,9 @@ namespace { { static Span sp; TRACE_FUNCTION; - + ::MIR::Function output; - + // 1. Monomorphise locals and temporaries output.named_variables.reserve( tpl->named_variables.size() ); for(const auto& var : tpl->named_variables) @@ -76,13 +76,13 @@ namespace { DEBUG("- var" << output.temporaries.size()); output.temporaries.push_back( params.monomorph(crate, ty) ); } - + // 2. Monomorphise all paths output.blocks.reserve( tpl->blocks.size() ); for(const auto& block : tpl->blocks) { ::std::vector< ::MIR::Statement> statements; - + TRACE_FUNCTION_F("bb" << output.blocks.size()); statements.reserve( block.statements.size() ); for(const auto& stmt : block.statements) @@ -101,7 +101,7 @@ namespace { { const auto& e = stmt.as_Assign(); DEBUG("- " << e.dst << " = " << e.src); - + ::MIR::RValue rval; TU_MATCHA( (e.src), (se), (Use, @@ -213,16 +213,16 @@ namespace { }); ) ) - + statements.push_back( ::MIR::Statement::make_Assign({ monomorph_LValue(crate, params, e.dst), mv$(rval) }) ); } } - + ::MIR::Terminator terminator; - + DEBUG("> " << block.terminator); TU_MATCHA( (block.terminator), (e), (Incomplete, @@ -278,9 +278,9 @@ namespace { }); ) ) - + output.blocks.push_back( ::MIR::BasicBlock { mv$(statements), mv$(terminator) } ); } - + return ::MIR::FunctionPointer( box$(output).release() ); } |