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