Get the position that a `cursor.next_inst()` call would move this cursor to, but do not update this cursor's position.
(&self)
| 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 | /// |
no test coverage detected