As per my discussions with Anna, removed MayWriteAndHaveSideEffects.

The reason we decided to do this is that MayHaveSideEffects implies that a write
can occur, making MayWriteAndHaveSideEffects redundent.

Swift SVN r7943
This commit is contained in:
Michael Gottesman
2013-09-05 06:57:25 +00:00
parent b9dea7f458
commit 6988171ee6
3 changed files with 5 additions and 8 deletions

View File

@@ -52,8 +52,7 @@ enum class SILInstructionMemoryBehavior {
/// result/users represent its effect.
MayHaveSideEffects,
/// \brief The instruction may write to memory.
MayWrite,
MayWriteAndHaveSideEffects
MayWrite
};
enum IsTake_t { IsNotTake, IsTake };

View File

@@ -140,7 +140,7 @@ ABSTRACT_VALUE(SILInstruction, ValueBase)
// Protocol and Protocol Composition Types
INST(InitExistentialInst, SILInstruction, MayWrite)
INST(UpcastExistentialInst, SILInstruction, MayWrite)
INST(DeinitExistentialInst, SILInstruction, MayWriteAndHaveSideEffects)
INST(DeinitExistentialInst, SILInstruction, MayHaveSideEffects)
INST(ProjectExistentialInst, SILInstruction, None)
INST(InitExistentialRefInst, SILInstruction, None)
INST(UpcastExistentialRefInst, SILInstruction, None)

View File

@@ -201,11 +201,9 @@ SILInstructionMemoryBehavior SILInstruction::getMemoryBehavior() const {
bool SILInstruction::mayHaveSideEffects() const {
SILInstructionMemoryBehavior B = getMemoryBehavior();
if (B == SILInstructionMemoryBehavior::MayWrite ||
B == SILInstructionMemoryBehavior::MayHaveSideEffects ||
B == SILInstructionMemoryBehavior::MayWriteAndHaveSideEffects)
return true;
return false;
return B == SILInstructionMemoryBehavior::MayWrite ||
B == SILInstructionMemoryBehavior::MayHaveSideEffects;
}
//===----------------------------------------------------------------------===//