1
Fork 0

New mir-opt pass to simplify gotos with const values

Fixes #77355
This commit is contained in:
Simon Vandel Sillesen 2020-10-03 11:18:24 +02:00
parent 15598a83db
commit a6dccfeb23
22 changed files with 652 additions and 374 deletions

View file

@ -1518,7 +1518,14 @@ pub enum StatementKind<'tcx> {
}
impl<'tcx> StatementKind<'tcx> {
pub fn as_assign_mut(&mut self) -> Option<&mut Box<(Place<'tcx>, Rvalue<'tcx>)>> {
pub fn as_assign_mut(&mut self) -> Option<&mut (Place<'tcx>, Rvalue<'tcx>)> {
match self {
StatementKind::Assign(x) => Some(x),
_ => None,
}
}
pub fn as_assign(&self) -> Option<&(Place<'tcx>, Rvalue<'tcx>)> {
match self {
StatementKind::Assign(x) => Some(x),
_ => None,