Move DefLocation from rustc_codegen_ssa to rustc_middle
This commit is contained in:
parent
6c348b77fe
commit
4357482bfd
2 changed files with 18 additions and 16 deletions
|
@ -1590,6 +1590,23 @@ impl Location {
|
|||
}
|
||||
}
|
||||
|
||||
/// `DefLocation` represents the location of a definition - either an argument or an assignment
|
||||
/// within MIR body.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum DefLocation {
|
||||
Argument,
|
||||
Body(Location),
|
||||
}
|
||||
|
||||
impl DefLocation {
|
||||
pub fn dominates(self, location: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
||||
match self {
|
||||
DefLocation::Argument => true,
|
||||
DefLocation::Body(def) => def.successor_within_block().dominates(location, dominators),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
||||
mod size_asserts {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue