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

Function parse_constraint

src/debug_utils/generic_function/parse.rs:307–319  ·  view source on GitHub ↗
(pair: Pair<'_, Rule>)

Source from the content-addressed store, hash-verified

305}
306
307fn parse_constraint(pair: Pair<'_, Rule>) -> Result<OperandConstraint> {
308 let constraint_pair = pair.into_inner().next().unwrap();
309 let constraint = match constraint_pair.as_rule() {
310 Rule::physreg => OperandConstraint::Fixed(parse_entity(constraint_pair)?),
311 Rule::regclass => OperandConstraint::Class(parse_entity(constraint_pair)?),
312 Rule::reuse => {
313 let [number] = extract(constraint_pair, [Rule::number]);
314 OperandConstraint::Reuse(parse_number(number)?)
315 }
316 _ => unreachable!(),
317 };
318 Ok(constraint)
319}
320
321fn parse_instruction(
322 pair: Pair<'_, Rule>,

Callers 2

parse_value_declarationFunction · 0.85
parse_operandFunction · 0.85

Calls 5

unwrapMethod · 0.80
parse_entityFunction · 0.70
extractFunction · 0.70
parse_numberFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected