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 {
1949
1949
evaluateOrDefault (
1950
1950
ctx.evaluator , LocalDiscriminatorsRequest{getParent ()}, 0 );
1951
1951
1952
+ #if NDEBUG
1953
+ static constexpr bool useFallbackDiscriminator = true ;
1954
+ #else
1955
+ static constexpr bool useFallbackDiscriminator = false ;
1956
+ #endif
1957
+
1952
1958
// If we don't have a discriminator, and either
1953
1959
// 1. We have ill-formed code and we're able to assign a discriminator, or
1954
1960
// 2. We are in a macro expansion buffer
@@ -1958,7 +1964,8 @@ unsigned AbstractClosureExpr::getDiscriminator() const {
1958
1964
if (getRawDiscriminator () == InvalidDiscriminator &&
1959
1965
(ctx.Diags .hadAnyError () ||
1960
1966
getParentSourceFile ()->getFulfilledMacroRole () != std::nullopt ||
1961
- getParent ()->isModuleScopeContext ())) {
1967
+ getParent ()->isModuleScopeContext () ||
1968
+ useFallbackDiscriminator)) {
1962
1969
auto discriminator = ctx.getNextDiscriminator (getParent ());
1963
1970
ctx.setMaxAssignedDiscriminator (getParent (), discriminator + 1 );
1964
1971
const_cast <AbstractClosureExpr *>(this )->
You can’t perform that action at this time.
0 commit comments