[dmd-internals] [D-Programming-Language/dmd] 25fb95: Restore constant folding for .length expressions

noreply at github.com noreply at github.com
Sun Apr 17 16:50:36 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/D-Programming-Language/dmd

Commit: 25fb95e7c8501f200e30fe591b656845ff318a2b
    https://github.com/D-Programming-Language/dmd/commit/25fb95e7c8501f200e30fe591b656845ff318a2b
Author: Don Clugston <dclugston at googlemail.com>
Date:   2011-04-17 (Sun, 17 Apr 2011)

Changed paths:
  M src/expression.h
  M src/optimize.c

Log Message:
-----------
Restore constant folding for .length expressions

Commit 7192ddf (fixing bug 4298) caused the loss of some array constant
folding. This caused implicit conversions to fail in a few cases, eg:
immutable table[][2] = [ ['a', 'b']];
short k = table.length; // fails because length not constant any more
This patch is an unsubtle fix: add a new optimize option, WANTexpand,
which reproduces the old behaviour. It is currently used only in array
length. (It could perhaps also be used in IndexExp).


Commit: 03423b324d9fd9d61878837825726c55907782df
    https://github.com/D-Programming-Language/dmd/commit/03423b324d9fd9d61878837825726c55907782df
Author: Walter Bright <walter at walterbright.com>
Date:   2011-04-17 (Sun, 17 Apr 2011)

Changed paths:
  M src/expression.h
  M src/optimize.c
  R test/fail_compilation/fail342.d

Log Message:
-----------
Merge branch 'structinit' of https://github.com/donc/dmd into pull32


Commit: 7740c0eab1b423a16c6b73bea7716a8b11d818f7
    https://github.com/D-Programming-Language/dmd/commit/7740c0eab1b423a16c6b73bea7716a8b11d818f7
Author: Walter Bright <walter at walterbright.com>
Date:   2011-04-17 (Sun, 17 Apr 2011)

Log Message:
-----------
Merge branch 'master' of github.com:D-Programming-Language/dmd


Compare: https://github.com/D-Programming-Language/dmd/compare/186b6a0...7740c0e


More information about the dmd-internals mailing list