Skip to content

Commit 3e235a2

Browse files
authored
Merge pull request swiftlang#35368 from eeckstein/diagnose-infinite-recursion
Improve diagnoses of infinite recursions
2 parents 1996e7b + d824fd3 commit 3e235a2

File tree

6 files changed

+675
-183
lines changed

6 files changed

+675
-183
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ WARNING(unreachable_case,none,
277277
WARNING(switch_on_a_constant,none,
278278
"switch condition evaluates to a constant", ())
279279
NOTE(unreachable_code_note,none, "will never be executed", ())
280-
WARNING(warn_infinite_recursive_function,none,
281-
"all paths through this function will call itself", ())
280+
WARNING(warn_infinite_recursive_call,none,
281+
"function call causes an infinite recursion", ())
282282

283283
// 'transparent' diagnostics
284284
ERROR(circular_transparent,none,

include/swift/SIL/SILBasicBlock.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
314314
const_succblock_iterator succblock_end() const {
315315
return getTerminator()->succblock_end();
316316
}
317+
318+
unsigned getNumSuccessors() const {
319+
return getTerminator()->getNumSuccessors();
320+
}
317321

318322
SILBasicBlock *getSingleSuccessorBlock() {
319323
return getTerminator()->getSingleSuccessorBlock();

0 commit comments

Comments
 (0)