(&mut self, pointee: Word)
| 515 | } |
| 516 | |
| 517 | fn ptr_ty(&mut self, pointee: Word) -> Word { |
| 518 | // TODO: This is horribly slow, fix this |
| 519 | let existing = self.types_global_values.iter().find(|inst| { |
| 520 | inst.class.opcode == Op::TypePointer |
| 521 | && inst.operands[0].unwrap_storage_class() == StorageClass::Function |
| 522 | && inst.operands[1].unwrap_id_ref() == pointee |
| 523 | }); |
| 524 | if let Some(existing) = existing { |
| 525 | return existing.result_id.unwrap(); |
| 526 | } |
| 527 | let inst_id = self.id(); |
| 528 | self.types_global_values.push(Instruction::new( |
| 529 | Op::TypePointer, |
| 530 | None, |
| 531 | Some(inst_id), |
| 532 | vec![ |
| 533 | Operand::StorageClass(StorageClass::Function), |
| 534 | Operand::IdRef(pointee), |
| 535 | ], |
| 536 | )); |
| 537 | inst_id |
| 538 | } |
| 539 | |
| 540 | fn inline_fn(&mut self, function: &mut Function) { |
| 541 | let mut block_idx = 0; |
no test coverage detected