ISLE: Always default the priority to 0 (#4983)
* Always default priorities to 0 in the ISLE IR * Fix a hidden overlap in the x64 backend
This commit is contained in:
@@ -431,8 +431,8 @@ pub struct Rule {
|
||||
/// The right-hand side expression that this rule evaluates upon successful
|
||||
/// match.
|
||||
pub rhs: Expr,
|
||||
/// The priority of this rule, if any.
|
||||
pub prio: Option<i64>,
|
||||
/// The priority of this rule, defaulted to 0 if it was missing in the source.
|
||||
pub prio: i64,
|
||||
/// The source position where this rule is defined.
|
||||
pub pos: Pos,
|
||||
}
|
||||
@@ -1394,7 +1394,7 @@ impl TermEnv {
|
||||
lhs,
|
||||
iflets,
|
||||
rhs,
|
||||
prio: rule.prio,
|
||||
prio: rule.prio.unwrap_or(0),
|
||||
pos,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ impl<'a> TermFunctionsBuilder<'a> {
|
||||
fn build(&mut self) {
|
||||
for rule in 0..self.termenv.rules.len() {
|
||||
let rule = RuleId(rule);
|
||||
let prio = self.termenv.rules[rule.index()].prio.unwrap_or(0);
|
||||
let prio = self.termenv.rules[rule.index()].prio;
|
||||
|
||||
let (pattern, expr) = lower_rule(self.typeenv, self.termenv, rule);
|
||||
let root_term = self.termenv.rules[rule.index()].lhs.root_term().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user