(pair: Pair<'_, Rule>, regs: &mut PrimaryMap<PhysReg, PhysRegData>)
| 115 | } |
| 116 | |
| 117 | fn parse_reg_def(pair: Pair<'_, Rule>, regs: &mut PrimaryMap<PhysReg, PhysRegData>) -> Result<()> { |
| 118 | let [reg, location, kind] = extract(pair, [Rule::reg, Rule::reg_location, Rule::reg_kind]); |
| 119 | parse_expected_entity(reg, regs.next_key())?; |
| 120 | let is_fixed_stack = location.as_str() == "stack"; |
| 121 | let kind = kind.into_inner().next().unwrap(); |
| 122 | let units = match kind.as_rule() { |
| 123 | Rule::nonallocatable => vec![], |
| 124 | Rule::unit_list => parse_entity_list(kind)?, |
| 125 | _ => unreachable!(), |
| 126 | }; |
| 127 | regs.push(PhysRegData { |
| 128 | bank: None, |
| 129 | is_fixed_stack, |
| 130 | units, |
| 131 | }); |
| 132 | Ok(()) |
| 133 | } |
| 134 | |
| 135 | fn parse_reg_group_def( |
| 136 | pair: Pair<'_, Rule>, |
no test coverage detected