diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-12 19:02:44 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-12 19:02:44 +0800 |
commit | a9f15d100cd8ad377834b725766b0731a60065f8 (patch) | |
tree | 4ecd89a82084630b55033c0816cedfb5aef89993 /src/mir/from_hir.cpp | |
parent | 6121ffe191f1f921eef8066d0ab5734bdae416a3 (diff) | |
download | mrust-a9f15d100cd8ad377834b725766b0731a60065f8.tar.gz |
MIR Gen Match - Unify match arm codegen (patterns separate)
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index e6203982..02baf445 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1015,6 +1015,14 @@ void MirBuilder::push_stmt_drop(::MIR::LValue val) m_output.blocks.at(m_current_block).statements.push_back( ::MIR::Statement::make_Drop({ ::MIR::eDropKind::DEEP, mv$(val) }) ); } +void MirBuilder::set_cur_block(unsigned int new_block) +{ + if( m_block_active ) { + BUG(Span(), "Updating block when previous is active"); + } + m_current_block = new_block; + m_block_active = true; +} void MirBuilder::end_block(::MIR::Terminator term) { if( !m_block_active ) { @@ -1024,13 +1032,13 @@ void MirBuilder::end_block(::MIR::Terminator term) m_block_active = false; m_current_block = 0; } -void MirBuilder::set_cur_block(unsigned int new_block) +void MirBuilder::pause_cur_block() { - if( m_block_active ) { - BUG(Span(), "Updating block when previous is active"); + if( !m_block_active ) { + BUG(Span(), "Pausing block when none active"); } - m_current_block = new_block; - m_block_active = true; + m_block_active = false; + m_current_block = 0; } ::MIR::BasicBlockId MirBuilder::new_bb_linked() { |