Skip to content

SILCloner and SILInliner rewrite. #19786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/swift/SIL/DebugUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ inline SILInstruction *getSingleNonDebugUser(SILValue V) {
/// Erases the instruction \p I from it's parent block and deletes it, including
/// all debug instructions which use \p I.
/// Precondition: The instruction may only have debug instructions as uses.
/// If the iterator \p InstIter references any deleted debug instruction, it is
/// If the iterator \p InstIter references any deleted instruction, it is
/// incremented.
inline void eraseFromParentWithDebugInsts(SILInstruction *I,
SILBasicBlock::iterator &InstIter) {
Expand All @@ -183,16 +183,17 @@ inline void eraseFromParentWithDebugInsts(SILInstruction *I,
foundAny = true;
auto *User = result->use_begin()->getUser();
assert(User->isDebugInstruction());
if (InstIter != SILBasicBlock::iterator() &&
InstIter != I->getParent()->end() &&
&*InstIter == User) {
if (InstIter == User->getIterator())
InstIter++;
}

User->eraseFromParent();
}
}
} while (foundAny);

if (InstIter == I->getIterator())
++InstIter;

I->eraseFromParent();
}

Expand Down
Loading