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

Method propagate_instances

crates/rustc_codegen_spirv/src/linker/specializer.rs:2287–2295  ·  view source on GitHub ↗

Process all instances seen (by `alloc_instance_id`) up until this point, to find the full set of instances (transitively) needed by the module. Warning**: calling `alloc_instance_id` later, without another call to `propagate_instances`, will potentially result in missed instances, i.e. that are added to `propagate_instances_queue` but never processed.

(&mut self)

Source from the content-addressed store, hash-verified

2285 /// `propagate_instances`, will potentially result in missed instances, i.e.
2286 /// that are added to `propagate_instances_queue` but never processed.
2287 fn propagate_instances(&mut self) {
2288 while let Some(instance) = self.propagate_instances_queue.pop_back() {
2289 // Drain the iterator to generate all the `alloc_instance_id` calls.
2290 for _ in self.specializer.generics[&instance.generic_id]
2291 .replacements
2292 .to_concrete(&instance.generic_args, |i| self.alloc_instance_id(i))
2293 {}
2294 }
2295 }
2296
2297 /// Expand every "generic" global/function, and `OpName`/decorations applied
2298 /// to them, to their respective full set of instances, treating the original

Callers 2

specializeFunction · 0.80
expand_moduleMethod · 0.80

Calls 2

to_concreteMethod · 0.80
alloc_instance_idMethod · 0.80

Tested by

no test coverage detected