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

Method next_inst_position

cranelift/codegen/src/cursor.rs:398–421  ·  view source on GitHub ↗

Get the position that a `cursor.next_inst()` call would move this cursor to, but do not update this cursor's position.

(&self)

Source from the content-addressed store, hash-verified

396 /// Get the position that a `cursor.next_inst()` call would move this cursor
397 /// to, but do not update this cursor's position.
398 fn next_inst_position(&self) -> Option<CursorPosition> {
399 use self::CursorPosition::*;
400 match self.position() {
401 Nowhere | After(..) => None,
402 At(inst) => {
403 if let Some(next) = self.layout().next_inst(inst) {
404 Some(At(next))
405 } else {
406 Some(After(
407 self.layout()
408 .inst_block(inst)
409 .expect("current instruction removed?"),
410 ))
411 }
412 }
413 Before(block) => {
414 if let Some(next) = self.layout().first_inst(block) {
415 Some(At(next))
416 } else {
417 Some(After(block))
418 }
419 }
420 }
421 }
422
423 /// Move to the next instruction in the same block and return it.
424 ///

Callers 2

next_positionMethod · 0.80
next_instMethod · 0.80

Implementers 2

cursor.rscranelift/codegen/src/cursor.rs
layout.rscranelift/codegen/src/ir/layout.rs

Calls 6

inst_blockMethod · 0.80
first_instMethod · 0.80
positionMethod · 0.45
next_instMethod · 0.45
layoutMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected