Skip to content

Commit 96f073d

Browse files
authored
Merge pull request #80401 from hamishknight/cond-assert
[ASTScope] Upgrade `checkSourceRangeBeforeAddingChild` to conditional assert
2 parents b1c345f + 946b61a commit 96f073d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,8 @@ void ASTScopeImpl::addChild(ASTScopeImpl *child, ASTContext &ctx) {
713713
ASTScopeAssert(!child->getParent(), "child should not already have parent");
714714
child->parentAndWasExpanded.setPointer(this);
715715

716-
#ifndef NDEBUG
717-
checkSourceRangeBeforeAddingChild(child, ctx);
718-
#endif
716+
if (CONDITIONAL_ASSERT_enabled())
717+
checkSourceRangeBeforeAddingChild(child, ctx);
719718

720719
// If this is the first time we've added children, notify the ASTContext
721720
// that there's a SmallVector that needs to be cleaned up.

0 commit comments

Comments
 (0)