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

Method is_child_loop

cranelift/codegen/src/loop_analysis.rs:144–153  ·  view source on GitHub ↗

Determines if a loop is contained in another loop. `is_child_loop(child,parent)` returns `true` if and only if `child` is a child loop of `parent` (or `child == parent`).

(&self, child: Loop, parent: Loop)

Source from the content-addressed store, hash-verified

142 /// `is_child_loop(child,parent)` returns `true` if and only if `child` is a child loop of
143 /// `parent` (or `child == parent`).
144 pub fn is_child_loop(&self, child: Loop, parent: Loop) -> bool {
145 let mut finger = Some(child);
146 while let Some(finger_loop) = finger {
147 if finger_loop == parent {
148 return true;
149 }
150 finger = self.loop_parent(finger_loop);
151 }
152 false
153 }
154
155 /// Returns the loop-nest level of a given block.
156 pub fn loop_level(&self, block: Block) -> LoopLevel {

Callers 1

is_in_loopMethod · 0.80

Calls 1

loop_parentMethod · 0.80

Tested by

no test coverage detected