mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Inline dominator check.
This commit is contained in:
parent
c2354aabea
commit
f83468c89b
@ -394,6 +394,7 @@ impl<Node: Idx> Dominators<Node> {
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if `b` is unreachable.
|
||||
#[inline]
|
||||
pub fn dominates(&self, a: Node, b: Node) -> bool {
|
||||
match &self.kind {
|
||||
Kind::Path => a.index() <= b.index(),
|
||||
|
@ -1604,6 +1604,7 @@ impl Location {
|
||||
false
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn dominates(&self, other: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
||||
if self.block == other.block {
|
||||
self.statement_index <= other.statement_index
|
||||
@ -1623,6 +1624,7 @@ pub enum DefLocation {
|
||||
}
|
||||
|
||||
impl DefLocation {
|
||||
#[inline]
|
||||
pub fn dominates(self, location: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
||||
match self {
|
||||
DefLocation::Argument => true,
|
||||
|
@ -94,6 +94,7 @@ impl SsaLocals {
|
||||
self.direct_uses[local]
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn assignment_dominates(
|
||||
&self,
|
||||
dominators: &Dominators<BasicBlock>,
|
||||
|
Loading…
Reference in New Issue
Block a user