Skip checks for common types with alignment 1

This commit is contained in:
Ben Kimock 2023-03-24 12:35:16 -04:00
parent a71b808d77
commit 67540ec950

View File

@ -99,6 +99,13 @@ fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location:
return;
}
if [self.tcx.types.bool, self.tcx.types.i8, self.tcx.types.u8, self.tcx.types.str_]
.contains(&pointee_ty)
{
debug!("Trivially aligned pointee type: {:?}", pointer_ty);
return;
}
self.pointers.push((pointer, pointee_ty))
}
}