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

Function parse_opcode

src/debug_utils/generic_function/parse.rs:227–252  ·  view source on GitHub ↗
(
    pair: Pair<'_, Rule>,
    data: &mut InstData,
    block_data: &mut BlockData,
)

Source from the content-addressed store, hash-verified

225}
226
227fn parse_opcode(
228 pair: Pair<'_, Rule>,
229 data: &mut InstData,
230 block_data: &mut BlockData,
231) -> Result<()> {
232 let pair = pair.into_inner().next().unwrap();
233 match pair.as_rule() {
234 Rule::normal_inst => {}
235 Rule::ret => {
236 data.terminator_kind = Some(TerminatorKind::Ret);
237 }
238 Rule::jump => {
239 data.terminator_kind = Some(TerminatorKind::Jump);
240 let [block, value_list] = extract(pair, [Rule::block, Rule::value_list]);
241 block_data.succs.push(parse_entity(block)?);
242 block_data.block_params_out = parse_entity_list(value_list)?;
243 }
244 Rule::branch => {
245 data.terminator_kind = Some(TerminatorKind::Branch);
246 let [block_list] = extract(pair, [Rule::block_list]);
247 block_data.succs = parse_entity_list(block_list)?;
248 }
249 _ => unreachable!(),
250 }
251 Ok(())
252}
253
254fn parse_attribute(pair: Pair<'_, Rule>, is_pure: &mut bool) -> Result<()> {
255 match pair.as_str() {

Callers 1

parse_instructionFunction · 0.85

Calls 6

unwrapMethod · 0.80
pushMethod · 0.80
extractFunction · 0.70
parse_entityFunction · 0.70
parse_entity_listFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected