summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-02-25 16:52:04 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-02-25 16:52:04 +0800
commitfdd7f1974bfccd9831ea273529866a57433750ee (patch)
tree1281503a6c6d59dd33567c04b64812bc7d7fb44d /src
parent77e7ae6b7aca72c6ebc930c148b61e7bec1c5a0e (diff)
downloadmrust-fdd7f1974bfccd9831ea273529866a57433750ee.tar.gz
MIR Gen - Replace infinite loop for default in match generation with a diverge terminator
Diffstat (limited to 'src')
-rw-r--r--src/mir/from_hir_match.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp
index 218809a4..b8fabdc0 100644
--- a/src/mir/from_hir_match.cpp
+++ b/src/mir/from_hir_match.cpp
@@ -504,6 +504,8 @@ void MIR_LowerHIR_Match( MirBuilder& builder, MirConverter& conv, ::HIR::ExprNod
}
}
+ // TODO: SplitSlice is buggy, make it fall back to simple?
+
// TODO: Don't generate inner code until decisions are generated (keeps MIR flow nice)
// - Challenging, as the decision code needs somewhere to jump to.
// - Allocating a BB and then rewriting references to it is a possibility.
@@ -2526,7 +2528,7 @@ void MIR_LowerHIR_Match_Grouped(
// Make the default infinite loop.
// - Preferably, it'd abort.
builder.set_cur_block(default_arm);
- builder.end_block( ::MIR::Terminator::make_Goto(default_arm) );
+ builder.end_block( ::MIR::Terminator::make_Diverge({}) );
}
void MatchGenGrouped::gen_for_slice(t_rules_subset arm_rules, size_t ofs, ::MIR::BasicBlockId default_arm)
{