[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

@@ -160,7 +160,7 @@ bool ConditionForwarding::tryOptimize(SwitchEnumInst *SEI) {
if (ArgUser == SEI)
continue;
if (isDebugInst(ArgUser))
if (ArgUser->isDebugInstruction())
continue;
if (ArgUser->getParent()->getSinglePredecessorBlock() == SEI->getParent()) {
@@ -227,7 +227,7 @@ bool ConditionForwarding::tryOptimize(SwitchEnumInst *SEI) {
while (!Arg->use_empty()) {
Operand *ArgUse = *Arg->use_begin();
SILInstruction *ArgUser = ArgUse->getUser();
if (isDebugInst(ArgUser)) {
if (ArgUser->isDebugInstruction()) {
// Don't care about debug instructions. Just remove them.
ArgUser->eraseFromParent();
continue;