SIL: add a utility function to check if a terminator exits a function. NFC

This commit is contained in:
Erik Eckstein
2016-03-31 09:27:33 -07:00
parent 66808b96b9
commit fd3f343dab
7 changed files with 18 additions and 12 deletions

View File

@@ -837,7 +837,7 @@ class AllocBoxToStack : public SILFunctionTransform {
for (auto &BB : *getFunction()) {
auto *Term = BB.getTerminator();
if (isa<ReturnInst>(Term) || isa<ThrowInst>(Term))
if (Term->isFunctionExiting())
Returns.push_back(Term);
for (auto &I : BB)