Skip to content

Commit 946b61a

Browse files
committed
[ASTScope] Upgrade checkSourceRangeBeforeAddingChild to conditional assert
Allow enabling in release builds.
1 parent 4efe08e commit 946b61a

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)