mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/master' into master-next
This commit is contained in:
@@ -50,6 +50,11 @@ public:
|
|||||||
/// Does instruction A properly dominate instruction B?
|
/// Does instruction A properly dominate instruction B?
|
||||||
bool properlyDominates(SILInstruction *a, SILInstruction *b);
|
bool properlyDominates(SILInstruction *a, SILInstruction *b);
|
||||||
|
|
||||||
|
/// Does instruction A dominate instruction B?
|
||||||
|
bool dominates(SILInstruction *a, SILInstruction *b) {
|
||||||
|
return a == b || properlyDominates(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
/// Does value A properly dominate instruction B?
|
/// Does value A properly dominate instruction B?
|
||||||
bool properlyDominates(SILValue a, SILInstruction *b);
|
bool properlyDominates(SILValue a, SILInstruction *b);
|
||||||
|
|
||||||
@@ -72,6 +77,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
using DominatorTreeBase::properlyDominates;
|
using DominatorTreeBase::properlyDominates;
|
||||||
|
using DominatorTreeBase::dominates;
|
||||||
|
|
||||||
bool isValid(SILFunction *F) const {
|
bool isValid(SILFunction *F) const {
|
||||||
return getNode(&F->front()) != nullptr;
|
return getNode(&F->front()) != nullptr;
|
||||||
|
|||||||
@@ -417,8 +417,9 @@ void SILBuilder::addOpenedArchetypeOperands(SILInstruction *I) {
|
|||||||
|
|
||||||
while (I && I->getNumOperands() == 1 &&
|
while (I && I->getNumOperands() == 1 &&
|
||||||
I->getNumTypeDependentOperands() == 0) {
|
I->getNumTypeDependentOperands() == 0) {
|
||||||
// All the open instructions are single-value instructions.
|
// All the open instructions are single-value instructions. Operands may
|
||||||
auto SVI = dyn_cast<SingleValueInstruction>(I->getOperand(0));
|
// be null when code is being transformed.
|
||||||
|
auto SVI = dyn_cast_or_null<SingleValueInstruction>(I->getOperand(0));
|
||||||
// Within SimplifyCFG this function may be called for an instruction
|
// Within SimplifyCFG this function may be called for an instruction
|
||||||
// within unreachable code. And within an unreachable block it can happen
|
// within unreachable code. And within an unreachable block it can happen
|
||||||
// that defs do not dominate uses (because there is no dominance defined).
|
// that defs do not dominate uses (because there is no dominance defined).
|
||||||
|
|||||||
Reference in New Issue
Block a user