Re: Functional Purity

2008-11-29 Thread Eric Botcazou
> The reason for posting this is to ask. Is there code in GCC that > already does something "similar" in say one of the optimisation passes > so i can get a look at how to get started on this? ipa-pure-const.c -- Eric Botcazou

Re: Functional Purity

2008-11-29 Thread Andrew Haley
Brendon Costa wrote: > I want to use GCC to categorise "functional purity" in C++. My > definition will differ from classic functional purity. In particular: > > A function is considered pure if it makes no changes to existing > memory or program state. There may be a few exceptions to this rule

Re: Functional Purity

2008-11-28 Thread David Fang
When categorising a functions purity i also would like to identify the cause of the impurity. In particular for a function that is impure i want to categorise the impurity cause as: * modifies global state * modifies a function parameter * modifies the object state (this is an extension of the fun