Use sparse representation of switch sources
to avoid quadratic space overhead
This commit is contained in:
parent
fbc3cc18be
commit
2be012a0c6
3 changed files with 8 additions and 10 deletions
|
@ -580,8 +580,8 @@ impl<'tcx> Body<'tcx> {
|
|||
self.predecessor_cache.compute(&self.basic_blocks)
|
||||
}
|
||||
|
||||
/// `body.switch_sources()[target][switch]` returns a list of switch values
|
||||
/// that lead to a `target` block from a `switch` block.
|
||||
/// `body.switch_sources()[&(target, switch)]` returns a list of switch
|
||||
/// values that lead to a `target` block from a `switch` block.
|
||||
#[inline]
|
||||
pub fn switch_sources(&self) -> &SwitchSources {
|
||||
self.switch_source_cache.compute(&self.basic_blocks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue