MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / ptr_ty

Method ptr_ty

crates/rustc_codegen_spirv/src/linker/inline.rs:517–538  ·  view source on GitHub ↗
(&mut self, pointee: Word)

Source from the content-addressed store, hash-verified

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;

Callers 1

inline_blockMethod · 0.80

Calls 2

iterMethod · 0.80
idMethod · 0.80

Tested by

no test coverage detected