The motivation for compiling the gcc with g++ is to allow for a fine tuned capture of information about the trees directly from the compiler. Currently, the access to the tree data structures are not wrapped as tightly as they could be. By using the c++ compiler we can monitor all read and write accesses to the tree nodes. that way we can isolate how they are used.
then we should be able to recreate a better and more well documented tree interface.
I have tried using java to compile the gcc source code, but it does not support operator overloading and makes you rework all types of things.
Here I have introduced a smart pointer for all the members. and a integer wrapper for the direct values.
At this point the bitfields are no longer optimized.
the next step would be to include the original tree definitions as the internal storage and use the wrapper for the public interface.
I have also replaced the central tree union as a base class.
The idea behind using classes instead of unions is this :
Later when we have reworked the parts, there should be no need for unions. The usage of virtual base classes and inheritance will remove the need for them.
we will need to do multiple iterations over the model before we get to the point that the gcc will run with a c++ compiled back end. It is sure to meet some critics, so we we keep the pages here until it is ready.
here is the consolidated header Introspector/GccCpp/mytypes.h]
Here is the edited tree header Introspector/GccCpp/tree.h
Here is the edited rtl header Introspector/GccCpp/rtl.h
Here is my current patch : Introspector/GccCpp/patch.diff