Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
swift-ci
2018-05-10 16:09:03 -07:00
33 changed files with 289 additions and 553 deletions

View File

@@ -669,10 +669,11 @@ public:
BeginAccessInst *createBeginAccess(SILLocation loc, SILValue address,
SILAccessKind accessKind,
SILAccessEnforcement enforcement,
bool noNestedConflict) {
bool noNestedConflict,
bool fromBuiltin) {
return insert(new (getModule()) BeginAccessInst(
getSILDebugLocation(loc), address, accessKind, enforcement,
noNestedConflict));
noNestedConflict, fromBuiltin));
}
EndAccessInst *createEndAccess(SILLocation loc, SILValue address,
@@ -685,18 +686,19 @@ public:
createBeginUnpairedAccess(SILLocation loc, SILValue address, SILValue buffer,
SILAccessKind accessKind,
SILAccessEnforcement enforcement,
bool noNestedConflict) {
bool noNestedConflict,
bool fromBuiltin) {
return insert(new (getModule()) BeginUnpairedAccessInst(
getSILDebugLocation(loc), address, buffer, accessKind, enforcement,
noNestedConflict));
noNestedConflict, fromBuiltin));
}
EndUnpairedAccessInst *createEndUnpairedAccess(SILLocation loc,
SILValue buffer,
SILAccessEnforcement enforcement,
bool aborted) {
EndUnpairedAccessInst *
createEndUnpairedAccess(SILLocation loc, SILValue buffer,
SILAccessEnforcement enforcement, bool aborted,
bool fromBuiltin) {
return insert(new (getModule()) EndUnpairedAccessInst(
getSILDebugLocation(loc), buffer, enforcement, aborted));
getSILDebugLocation(loc), buffer, enforcement, aborted, fromBuiltin));
}
AssignInst *createAssign(SILLocation Loc, SILValue Src, SILValue DestAddr) {

View File

@@ -809,7 +809,8 @@ void SILCloner<ImplClass>::visitBeginAccessInst(BeginAccessInst *Inst) {
getOpValue(Inst->getOperand()),
Inst->getAccessKind(),
Inst->getEnforcement(),
Inst->hasNoNestedConflict()));
Inst->hasNoNestedConflict(),
Inst->isFromBuiltin()));
}
template <typename ImplClass>
@@ -831,18 +832,19 @@ void SILCloner<ImplClass>::visitBeginUnpairedAccessInst(
getOpValue(Inst->getBuffer()),
Inst->getAccessKind(),
Inst->getEnforcement(),
Inst->hasNoNestedConflict()));
Inst->hasNoNestedConflict(),
Inst->isFromBuiltin()));
}
template <typename ImplClass>
void SILCloner<ImplClass>::visitEndUnpairedAccessInst(
EndUnpairedAccessInst *Inst) {
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
doPostProcess(
Inst, getBuilder().createEndUnpairedAccess(getOpLocation(Inst->getLoc()),
getOpValue(Inst->getOperand()),
Inst->getEnforcement(),
Inst->isAborting()));
doPostProcess(Inst,
getBuilder().createEndUnpairedAccess(
getOpLocation(Inst->getLoc()),
getOpValue(Inst->getOperand()), Inst->getEnforcement(),
Inst->isAborting(), Inst->isFromBuiltin()));
}
template <typename ImplClass>

View File

@@ -3229,12 +3229,14 @@ class BeginAccessInst
BeginAccessInst(SILDebugLocation loc, SILValue lvalue,
SILAccessKind accessKind, SILAccessEnforcement enforcement,
bool noNestedConflict)
bool noNestedConflict, bool fromBuiltin)
: UnaryInstructionBase(loc, lvalue, lvalue->getType()) {
SILInstruction::Bits.BeginAccessInst.AccessKind = unsigned(accessKind);
SILInstruction::Bits.BeginAccessInst.Enforcement = unsigned(enforcement);
SILInstruction::Bits.BeginAccessInst.NoNestedConflict =
unsigned(noNestedConflict);
SILInstruction::Bits.BeginAccessInst.FromBuiltin =
unsigned(fromBuiltin);
static_assert(unsigned(SILAccessKind::Last) < (1 << 2),
"reserve sufficient bits for serialized SIL");
@@ -3278,6 +3280,13 @@ public:
SILInstruction::Bits.BeginAccessInst.NoNestedConflict = noNestedConflict;
}
/// Return true if this access marker was emitted for a user-controlled
/// Builtin. Return false if this access marker was auto-generated by the
/// compiler to enforce formal access that derives from the language.
bool isFromBuiltin() const {
return SILInstruction::Bits.BeginAccessInst.FromBuiltin;
}
SILValue getSource() const {
return getOperand();
}
@@ -3358,7 +3367,8 @@ class BeginUnpairedAccessInst
BeginUnpairedAccessInst(SILDebugLocation loc, SILValue addr, SILValue buffer,
SILAccessKind accessKind,
SILAccessEnforcement enforcement,
bool noNestedConflict)
bool noNestedConflict,
bool fromBuiltin)
: InstructionBase(loc), Operands(this, addr, buffer) {
SILInstruction::Bits.BeginUnpairedAccessInst.AccessKind =
unsigned(accessKind);
@@ -3366,6 +3376,8 @@ class BeginUnpairedAccessInst
unsigned(enforcement);
SILInstruction::Bits.BeginUnpairedAccessInst.NoNestedConflict =
unsigned(noNestedConflict);
SILInstruction::Bits.BeginUnpairedAccessInst.FromBuiltin =
unsigned(fromBuiltin);
}
public:
@@ -3400,6 +3412,13 @@ public:
noNestedConflict;
}
/// Return true if this access marker was emitted for a user-controlled
/// Builtin. Return false if this access marker was auto-generated by the
/// compiler to enforce formal access that derives from the language.
bool isFromBuiltin() const {
return SILInstruction::Bits.BeginUnpairedAccessInst.FromBuiltin;
}
SILValue getSource() const {
return Operands[0].get();
}
@@ -3428,11 +3447,13 @@ class EndUnpairedAccessInst
private:
EndUnpairedAccessInst(SILDebugLocation loc, SILValue buffer,
SILAccessEnforcement enforcement, bool aborting = false)
SILAccessEnforcement enforcement, bool aborting,
bool fromBuiltin)
: UnaryInstructionBase(loc, buffer) {
SILInstruction::Bits.EndUnpairedAccessInst.Enforcement
= unsigned(enforcement);
SILInstruction::Bits.EndUnpairedAccessInst.Aborting = aborting;
SILInstruction::Bits.EndUnpairedAccessInst.FromBuiltin = fromBuiltin;
}
public:
@@ -3458,6 +3479,13 @@ public:
unsigned(enforcement);
}
/// Return true if this access marker was emitted for a user-controlled
/// Builtin. Return false if this access marker was auto-generated by the
/// compiler to enforce formal access that derives from the language.
bool isFromBuiltin() const {
return SILInstruction::Bits.EndUnpairedAccessInst.FromBuiltin;
}
SILValue getBuffer() const {
return getOperand();
}

View File

@@ -258,24 +258,28 @@ protected:
SWIFT_INLINE_BITFIELD(BeginAccessInst, SingleValueInstruction,
NumSILAccessKindBits+NumSILAccessEnforcementBits
+ 1,
+ 1 + 1,
AccessKind : NumSILAccessKindBits,
Enforcement : NumSILAccessEnforcementBits,
NoNestedConflict : 1
NoNestedConflict : 1,
FromBuiltin : 1
);
SWIFT_INLINE_BITFIELD(BeginUnpairedAccessInst, NonValueInstruction,
NumSILAccessKindBits + NumSILAccessEnforcementBits + 1,
NumSILAccessKindBits + NumSILAccessEnforcementBits
+ 1 + 1,
AccessKind : NumSILAccessKindBits,
Enforcement : NumSILAccessEnforcementBits,
NoNestedConflict : 1);
NoNestedConflict : 1,
FromBuiltin : 1);
SWIFT_INLINE_BITFIELD(EndAccessInst, NonValueInstruction, 1,
Aborting : 1
);
SWIFT_INLINE_BITFIELD(EndUnpairedAccessInst, NonValueInstruction,
NumSILAccessEnforcementBits + 1,
NumSILAccessEnforcementBits + 1 + 1,
Enforcement : NumSILAccessEnforcementBits,
Aborting : 1);
Aborting : 1,
FromBuiltin : 1);
SWIFT_INLINE_BITFIELD(StoreInst, NonValueInstruction,
NumStoreOwnershipQualifierBits,