Get the destinations of this instruction, if it's a branch. `br_table` returns the empty slice.
(
&'a self,
jump_tables: &'a ir::JumpTables,
exception_tables: &'a ir::ExceptionTables,
)
| 424 | /// |
| 425 | /// `br_table` returns the empty slice. |
| 426 | pub fn branch_destination<'a>( |
| 427 | &'a self, |
| 428 | jump_tables: &'a ir::JumpTables, |
| 429 | exception_tables: &'a ir::ExceptionTables, |
| 430 | ) -> &'a [BlockCall] { |
| 431 | match self { |
| 432 | Self::Jump { destination, .. } => core::slice::from_ref(destination), |
| 433 | Self::Brif { blocks, .. } => blocks.as_slice(), |
| 434 | Self::BranchTable { table, .. } => jump_tables.get(*table).unwrap().all_branches(), |
| 435 | Self::TryCall { exception, .. } | Self::TryCallIndirect { exception, .. } => { |
| 436 | exception_tables.get(*exception).unwrap().all_branches() |
| 437 | } |
| 438 | _ => { |
| 439 | debug_assert!(!self.opcode().is_branch()); |
| 440 | &[] |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | /// Get a mutable slice of the destinations of this instruction, if it's a branch. |
| 446 | /// |
no test coverage detected