So are you officially rejecting pure functions and my future work on them in this form?

Gareth aka. Kit

On 29/04/2020 21:40, Jonas Maebe wrote:
On 29/04/2020 22:08, J. Gareth Moreton wrote:
Constant propagation is only really beneficial for inline functions,
That is incorrect.

although there is some crossover with pure functions. I was more meaning
a system of tracking and storing these constants, or rather how they
manipulate variables throughout a pure function.
That is exactly what -Ooconstprop does, although (as mentioned before),
to a quite limited extent. It doesn't extract the constants from the
nodes, but replaces variables (load nodes) with the constant nodes that
were assigned to them earlier, and then at the end runs the simplify
pass over the resulting node tree. The simplify pass already contains
all support for merging expressions involving only constant nodes into
single constants, so it has no need for storing the constant data in a
separate structure and then duplicate all the constant evaluations for
that extra structure.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to