Skip to content

Commit a191795

Browse files
committed
[NFC] Simplified isAncestorScope.
Clarified preconditions, removed spurious explicit typing, and suprious control flow.
1 parent 0120f13 commit a191795

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5824,14 +5824,12 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
58245824
// the scope is an ancestor of the scope we're currently leaving.
58255825
auto isAncestorScope = [](const SILDebugScope *Cur,
58265826
const SILDebugScope *Previous) {
5827+
assert(Cur && "null current scope queried");
5828+
assert(Previous && "null previous scope queried");
58275829
const SILDebugScope *Tmp = Previous;
5828-
assert(Tmp && "scope can't be null");
58295830
while (Tmp) {
5830-
PointerUnion<const SILDebugScope *, SILFunction *> Parent =
5831-
Tmp->Parent;
5831+
auto Parent = Tmp->Parent;
58325832
auto *ParentScope = Parent.dyn_cast<const SILDebugScope *>();
5833-
if (!ParentScope)
5834-
break;
58355833
if (ParentScope == Cur)
58365834
return true;
58375835
Tmp = ParentScope;

0 commit comments

Comments
 (0)