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 @@ -1934,6 +1934,12 @@ unsigned AbstractClosureExpr::getDiscriminator() const {
19341934 evaluateOrDefault (
19351935 ctx.evaluator , LocalDiscriminatorsRequest{getParent ()}, 0 );
19361936
1937+ #if NDEBUG
1938+ static constexpr bool useFallbackDiscriminator = true ;
1939+ #else
1940+ static constexpr bool useFallbackDiscriminator = false ;
1941+ #endif
1942+
19371943 // If we don't have a discriminator, and either
19381944 // 1. We have ill-formed code and we're able to assign a discriminator, or
19391945 // 2. We are in a macro expansion buffer
@@ -1943,7 +1949,8 @@ unsigned AbstractClosureExpr::getDiscriminator() const {
19431949 if (getRawDiscriminator () == InvalidDiscriminator &&
19441950 (ctx.Diags .hadAnyError () ||
19451951 getParentSourceFile ()->getFulfilledMacroRole () != std::nullopt ||
1946- getParent ()->isModuleScopeContext ())) {
1952+ getParent ()->isModuleScopeContext () ||
1953+ useFallbackDiscriminator)) {
19471954 auto discriminator = ctx.getNextDiscriminator (getParent ());
19481955 ctx.setMaxAssignedDiscriminator (getParent (), discriminator + 1 );
19491956 const_cast <AbstractClosureExpr *>(this )->
You can’t perform that action at this time.
0 commit comments