MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / parse_reg_def

Function parse_reg_def

src/debug_utils/generic_reginfo/parse.rs:117–133  ·  view source on GitHub ↗
(pair: Pair<'_, Rule>, regs: &mut PrimaryMap<PhysReg, PhysRegData>)

Source from the content-addressed store, hash-verified

115}
116
117fn 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
135fn parse_reg_group_def(
136 pair: Pair<'_, Rule>,

Callers 1

parseMethod · 0.85

Calls 7

next_keyMethod · 0.80
unwrapMethod · 0.80
pushMethod · 0.80
extractFunction · 0.70
parse_expected_entityFunction · 0.70
parse_entity_listFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected