Skip to content

Commit f83468c

Browse files
committed
Inline dominator check.
1 parent c2354aa commit f83468c

File tree

3 files changed

+4
-0
lines changed
  • compiler
    • rustc_data_structures/src/graph/dominators
    • rustc_middle/src/mir
    • rustc_mir_transform/src

3 files changed

+4
-0
lines changed

compiler/rustc_data_structures/src/graph/dominators/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ impl<Node: Idx> Dominators<Node> {
394394
/// # Panics
395395
///
396396
/// Panics if `b` is unreachable.
397+
#[inline]
397398
pub fn dominates(&self, a: Node, b: Node) -> bool {
398399
match &self.kind {
399400
Kind::Path => a.index() <= b.index(),

compiler/rustc_middle/src/mir/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,7 @@ impl Location {
16041604
false
16051605
}
16061606

1607+
#[inline]
16071608
pub fn dominates(&self, other: Location, dominators: &Dominators<BasicBlock>) -> bool {
16081609
if self.block == other.block {
16091610
self.statement_index <= other.statement_index
@@ -1623,6 +1624,7 @@ pub enum DefLocation {
16231624
}
16241625

16251626
impl DefLocation {
1627+
#[inline]
16261628
pub fn dominates(self, location: Location, dominators: &Dominators<BasicBlock>) -> bool {
16271629
match self {
16281630
DefLocation::Argument => true,

compiler/rustc_mir_transform/src/ssa.rs

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl SsaLocals {
9494
self.direct_uses[local]
9595
}
9696

97+
#[inline]
9798
pub fn assignment_dominates(
9899
&self,
99100
dominators: &Dominators<BasicBlock>,

0 commit comments

Comments
 (0)