Revert "[SILOptimizer] Don't diagnose infinite recursion if a branch terminates (#19724)"

This reverts commit e94450e840.

rdar://45080912
This commit is contained in:
Graydon Hoare
2018-10-07 23:54:17 -07:00
parent 08acbf33de
commit cc16ddfd13
18 changed files with 104 additions and 183 deletions

View File

@@ -1061,30 +1061,6 @@ bool TermInst::isFunctionExiting() const {
llvm_unreachable("Unhandled TermKind in switch.");
}
bool TermInst::isProgramTerminating() const {
switch (getTermKind()) {
case TermKind::BranchInst:
case TermKind::CondBranchInst:
case TermKind::SwitchValueInst:
case TermKind::SwitchEnumInst:
case TermKind::SwitchEnumAddrInst:
case TermKind::DynamicMethodBranchInst:
case TermKind::CheckedCastBranchInst:
case TermKind::CheckedCastValueBranchInst:
case TermKind::CheckedCastAddrBranchInst:
case TermKind::TryApplyInst:
case TermKind::YieldInst:
case TermKind::ReturnInst:
case TermKind::ThrowInst:
case TermKind::UnwindInst:
return false;
case TermKind::UnreachableInst:
return true;
}
llvm_unreachable("Unhandled TermKind in switch.");
}
TermInst::SuccessorBlockArgumentsListTy
TermInst::getSuccessorBlockArguments() const {
function_ref<PhiArgumentArrayRef(const SILSuccessor &)> op;