Skip to content

Commit

Permalink
Lower MIR Match - Fix MSVC compile error (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Jan 12, 2022
1 parent 4bee889 commit 6f42b74
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/mir/from_hir_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,29 +387,35 @@ void MIR_LowerHIR_Match( MirBuilder& builder, MirConverter& conv, ::HIR::ExprNod
if( same_bindings )
{
TRACE_FUNCTION_FR("Bindings (common)", "Bindings (common)");
unsigned cond_false_block = ~0u;
MIR::BasicBlockId cond_false_block = ~0u;
auto entry_block = builder.new_bb_unlinked();
builder.set_cur_block( entry_block );

emit_condition(cond_false_block, arm_rules[first_arm_rule_idx].m_bindings);

for(size_t i = first_arm_rule_idx; i < arm_rules.size(); i ++)
{
ac.rules.push_back(ArmCode::Pattern { entry_block, cond_false_block });
ArmCode::Pattern acp;
acp.entry = entry_block;
acp.cond_false = cond_false_block;
ac.rules.push_back(acp);
}
}
else
{
for(size_t i = first_arm_rule_idx; i < arm_rules.size(); i ++)
{
TRACE_FUNCTION_FR("Bindings (AR" << i << ")", "Bindings (AR" << i << ")");
unsigned cond_false_block = ~0u;
MIR::BasicBlockId cond_false_block = ~0u;
auto entry_block = builder.new_bb_unlinked();
builder.set_cur_block( entry_block );

emit_condition(cond_false_block, arm_rules[i].m_bindings);

ac.rules.push_back(ArmCode::Pattern { entry_block, cond_false_block });
ArmCode::Pattern acp;
acp.entry = entry_block;
acp.cond_false = cond_false_block;
ac.rules.push_back(acp);
}
}
}
Expand Down

0 comments on commit 6f42b74

Please sign in to comment.