On Tue, Apr 10, 2012 at 4:46 PM, Jakub Jelinek <ja...@redhat.com> wrote: > >> *) gcc implementation has lots of hard coded TREE_OPERAND (exp, nn) >> >> e.g. >> exp->as_component_ref().get_field() .. >> exp->as_mem_access().get_base() ... >> exp->as_mem_acesss().get_address() --> produces the >> address expression for memory access >> exp->as_mem_access().get_alias_handle () >> >> gimple_inst->serialize (&fixup_list) --> a virtual >> function overriden by actual instruction types that knows its byte >> code format. > > That silently assumes we want to change basic GIMPLE/tree data structures > to virtual classes, which is a significant change that has a significant > cost as well. E.g. all such changed data structures grow by a virtual > pointer field. Those data structures are heavily optimized for memory > footprint. > Not to mention it is very questionable if the above stuff is more readable > than what we currently have. >
And I want to say that tree/gimple/rtl are compiler's data(or state), not compiler's text(or logic), the most important thing about them is how to access their fields. -- Chiheng Xu