From 76583192a88146640199b21623da3893e47c6877 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 6 Dec 2018 09:36:48 -0500 Subject: [PATCH] Change ZeroOneOrMore::Zero() to TableElementType::Zero. --- lib/frontend/src/ssa.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index a78ed0b890..15ba1c98ca 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -192,9 +192,9 @@ impl SSABuilder { /// Small enum used for clarity in some functions. #[derive(Debug)] enum ZeroOneOrMore { - Zero(), + Zero, One(T), - More(), + More, } #[derive(Debug)] @@ -526,7 +526,7 @@ impl SSABuilder { temp_arg_var: Variable, dest_ebb: Ebb, ) { - let mut pred_values: ZeroOneOrMore = ZeroOneOrMore::Zero(); + let mut pred_values: ZeroOneOrMore = ZeroOneOrMore::Zero; // Iterate over the predecessors. for _ in 0..self.predecessors(dest_ebb).len() { @@ -534,21 +534,21 @@ impl SSABuilder { // to var and we put it as an argument of the branch instruction. let pred_val = self.results.pop().unwrap(); match pred_values { - ZeroOneOrMore::Zero() => { + ZeroOneOrMore::Zero => { if pred_val != temp_arg_val { pred_values = ZeroOneOrMore::One(pred_val); } } ZeroOneOrMore::One(old_val) => { if pred_val != temp_arg_val && pred_val != old_val { - pred_values = ZeroOneOrMore::More(); + pred_values = ZeroOneOrMore::More; } } - ZeroOneOrMore::More() => {} + ZeroOneOrMore::More => {} } } let result_val = match pred_values { - ZeroOneOrMore::Zero() => { + ZeroOneOrMore::Zero => { // The variable is used but never defined before. This is an irregularity in the // code, but rather than throwing an error we silently initialize the variable to // 0. This will have no effect since this situation happens in unreachable code. @@ -583,7 +583,7 @@ impl SSABuilder { func.dfg.change_to_alias(temp_arg_val, resolved); resolved } - ZeroOneOrMore::More() => { + ZeroOneOrMore::More => { // There is disagreement in the predecessors on which value to use so we have // to keep the ebb argument. To avoid borrowing `self` for the whole loop, // temporarily detach the predecessors list and replace it with an empty list.