File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1949,6 +1949,12 @@ unsigned AbstractClosureExpr::getDiscriminator() const {
19491949 evaluateOrDefault (
19501950 ctx.evaluator , LocalDiscriminatorsRequest{getParent ()}, 0 );
19511951
1952+ #if NDEBUG
1953+ static constexpr bool useFallbackDiscriminator = true ;
1954+ #else
1955+ static constexpr bool useFallbackDiscriminator = false ;
1956+ #endif
1957+
19521958 // If we don't have a discriminator, and either
19531959 // 1. We have ill-formed code and we're able to assign a discriminator, or
19541960 // 2. We are in a macro expansion buffer
@@ -1958,7 +1964,8 @@ unsigned AbstractClosureExpr::getDiscriminator() const {
19581964 if (getRawDiscriminator () == InvalidDiscriminator &&
19591965 (ctx.Diags .hadAnyError () ||
19601966 getParentSourceFile ()->getFulfilledMacroRole () != std::nullopt ||
1961- getParent ()->isModuleScopeContext ())) {
1967+ getParent ()->isModuleScopeContext () ||
1968+ useFallbackDiscriminator)) {
19621969 auto discriminator = ctx.getNextDiscriminator (getParent ());
19631970 ctx.setMaxAssignedDiscriminator (getParent (), discriminator + 1 );
19641971 const_cast <AbstractClosureExpr *>(this )->
You can’t perform that action at this time.
0 commit comments