Merge pull request #8090 from shajrawi/ConsumptionKind_UnconditionalCheckedCastValue

Add consumption kind to UnconditionalCheckedCastValueInst
This commit is contained in:
Joe Shajrawi
2017-03-14 15:30:26 -07:00
committed by GitHub
17 changed files with 80 additions and 36 deletions

View File

@@ -2862,16 +2862,24 @@ class UnconditionalCheckedCastValueInst final
ValueKind::UnconditionalCheckedCastValueInst,
UnconditionalCheckedCastValueInst, ConversionInst, true> {
friend SILBuilder;
CastConsumptionKind ConsumptionKind;
UnconditionalCheckedCastValueInst(SILDebugLocation DebugLoc, SILValue Operand,
UnconditionalCheckedCastValueInst(SILDebugLocation DebugLoc,
CastConsumptionKind consumption,
SILValue Operand,
ArrayRef<SILValue> TypeDependentOperands,
SILType DestTy)
: UnaryInstructionWithTypeDependentOperandsBase(
DebugLoc, Operand, TypeDependentOperands, DestTy) {}
DebugLoc, Operand, TypeDependentOperands, DestTy),
ConsumptionKind(consumption) {}
static UnconditionalCheckedCastValueInst *
create(SILDebugLocation DebugLoc, SILValue Operand, SILType DestTy,
SILFunction &F, SILOpenedArchetypesState &OpenedArchetypes);
create(SILDebugLocation DebugLoc, CastConsumptionKind consumption,
SILValue Operand, SILType DestTy, SILFunction &F,
SILOpenedArchetypesState &OpenedArchetypes);
public:
CastConsumptionKind getConsumptionKind() const { return ConsumptionKind; }
};
/// StructInst - Represents a constructed loadable struct.