[SILInstruction] Introduce isDebugInstruction().

This is a property of an instruction and should be a member
function of `SILInstruction` and not a free function in
`DebugUtils`. Discussed with Adrian.
This commit is contained in:
Davide Italiano
2018-04-11 08:29:49 -07:00
parent b36a551550
commit b4d563802b
9 changed files with 27 additions and 26 deletions

View File

@@ -579,7 +579,7 @@ bool COWArrayOpt::checkSafeArrayAddressUses(UserList &AddressUsers) {
for (auto *UseInst : AddressUsers) {
if (isDebugInst(UseInst))
if (UseInst->isDebugInstruction())
continue;
if (auto *AI = dyn_cast<ApplyInst>(UseInst)) {
@@ -698,7 +698,7 @@ bool COWArrayOpt::checkSafeArrayValueUses(UserList &ArrayValueUsers) {
if (isa<MarkDependenceInst>(UseInst))
continue;
if (isDebugInst(UseInst))
if (UseInst->isDebugInstruction())
continue;
// Found an unsafe or unknown user. The Array may escape here.
@@ -761,7 +761,7 @@ bool COWArrayOpt::checkSafeArrayElementUse(SILInstruction *UseInst,
if (isa<MarkDependenceInst>(UseInst))
return true;
if (isDebugInst(UseInst))
if (UseInst->isDebugInstruction())
return true;
// If this is an instruction which is a safe array element use if and only if
@@ -1764,7 +1764,7 @@ private:
bool checkSafeArrayAddressUses(UserList &AddressUsers) {
for (auto *UseInst : AddressUsers) {
if (isDebugInst(UseInst))
if (UseInst->isDebugInstruction())
continue;
if (isa<DeallocStackInst>(UseInst)) {