ref $($mutability)* inputs,
asm: _ } => {
for output in & $($mutability)* outputs[..] {
- self.visit_place(output, PlaceContext::Store, location);
+ self.visit_place(output, PlaceContext::AsmOutput, location);
}
for input in & $($mutability)* inputs[..] {
self.visit_operand(input, location);
// Appears as LHS of an assignment
Store,
+ // Can often be treated as a Store, but needs to be separate because
+ // ASM is allowed to read outputs as well, so a Store-AsmOutput sequence
+ // cannot be simplified the way a Store-Store can be.
+ AsmOutput,
+
// Dest of a call
Call,
/// Returns true if this place context represents a use that potentially changes the value.
pub fn is_mutating_use(&self) -> bool {
match *self {
- PlaceContext::Store | PlaceContext::Call |
+ PlaceContext::Store | PlaceContext::AsmOutput | PlaceContext::Call |
PlaceContext::Borrow { kind: BorrowKind::Mut, .. } |
PlaceContext::Projection(Mutability::Mut) |
PlaceContext::Drop => true,
PlaceContext::Projection(Mutability::Not) |
PlaceContext::Copy | PlaceContext::Move => true,
PlaceContext::Borrow { kind: BorrowKind::Mut, .. } | PlaceContext::Store |
+ PlaceContext::AsmOutput |
PlaceContext::Call | PlaceContext::Projection(Mutability::Mut) |
PlaceContext::Drop | PlaceContext::StorageLive | PlaceContext::StorageDead |
PlaceContext::Validate => false,
// "deep" does validation go?
PlaceContext::Validate => false,
+ // FIXME: This is here to not change behaviour from before
+ // AsmOutput existed, but it's not necessarily a pure overwrite.
+ // so it's possible this should activate the place.
+ PlaceContext::AsmOutput |
// pure overwrites of an place do not activate it. (note
// PlaceContext::Call is solely about dest place)
PlaceContext::Store | PlaceContext::Call => false,