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

Method value_is_attached

cranelift/codegen/src/ir/dfg.rs:420–428  ·  view source on GitHub ↗

Determine if `v` is an attached instruction result / block parameter. An attached value can't be attached to something else without first being detached. Value aliases are not considered to be attached to anything. Use `resolve_aliases()` to determine if the original aliased value is attached.

(&self, v: Value)

Source from the content-addressed store, hash-verified

418 /// Value aliases are not considered to be attached to anything. Use `resolve_aliases()` to
419 /// determine if the original aliased value is attached.
420 pub fn value_is_attached(&self, v: Value) -> bool {
421 use self::ValueData::*;
422 match ValueData::from(self.values[v]) {
423 Inst { inst, num, .. } => Some(&v) == self.inst_results(inst).get(num as usize),
424 Param { block, num, .. } => Some(&v) == self.block_params(block).get(num as usize),
425 Alias { .. } => false,
426 Union { .. } => false,
427 }
428 }
429
430 /// Resolve value aliases.
431 ///

Callers 1

Calls 4

fromFunction · 0.85
getMethod · 0.45
inst_resultsMethod · 0.45
block_paramsMethod · 0.45

Tested by

no test coverage detected