MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / alias_map

Function alias_map

cranelift/codegen/src/write.rs:163–172  ·  view source on GitHub ↗

Create a reverse-alias map from a value to all aliases having that value as a direct target

(func: &Function)

Source from the content-addressed store, hash-verified

161
162/// Create a reverse-alias map from a value to all aliases having that value as a direct target
163fn alias_map(func: &Function) -> SecondaryMap<Value, Vec<Value>> {
164 let mut aliases = SecondaryMap::<_, Vec<_>>::new();
165 for v in func.dfg.values() {
166 // VADFS returns the immediate target of an alias
167 if let Some(k) = func.dfg.value_alias_dest_for_serialization(v) {
168 aliases[k].push(v);
169 }
170 }
171 aliases
172}
173
174/// Writes `func` to `w` as text.
175/// write_function_plain is passed as 'closure' to print instructions as text.

Callers 1

decorate_functionFunction · 0.85

Calls 4

newFunction · 0.50
valuesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected