d: Merge upstream dmd 8508c4e68.
Fixes a performance bug where 'static foreach' would take an exponentially long time to expand during CTFE. In the following example: static foreach (i; 0..30000) {} Compilation time had been reduced from around 40 to 0.08 seconds. Memory consumption is also reduced from 3.5GB to 55MB. Reviewed-on: https://github.com/dlang/dmd/pull/11335 gcc/d/ChangeLog: * dmd/cond.c (lowerArrayAggregate): Directly use the elements of the array for TupleExp creation. (lowerNonArrayAggregate): Inline creation of foreach range indexes. (cherry picked from commit ce56fd949f359a62b86a45aaf975ac2ecc48fa64)
Showing
Please
register
or
sign in
to comment