[PATCH]: convert (long)round(d) -> lround(d), etc

Roger Sayle roger@eyesopen.com
Thu Apr 29 18:38:00 GMT 2004


On 29 Apr 2004, Tom Tromey wrote:
> It seems to me that if these types are going to be used by the middle
> end, then we might as well define them in the generic part of gcc.
> And, more generally, I think it would be great if we could write down
> exactly what the middle end expects in terms of defined types, and
> anything else like that, to make writing a front end a more
> well-defined experience.

Hi Tom,

The function you want is called "build_common_tree_nodes" in tree.c
that is responsible for building all of the tree nodes common to the
different language front-ends.  For example, this function creates
the tree node for "error_mark_node", etc...

This function is used by the ada, c, c++, f77, objc and treelang
front-ends front-ends.  The java front-end, however, currently doesn't
use this function and instead builds error_mark_node et al. itself in
java_init_decl_processing.

To quote the comment in java/decl.c:
  /* The code here must be similar to build_common_tree_nodes{,_2} in
     tree.c, especially as to the order of initializing common nodes.  */


But you're right perhaps we should explictly write down that the
middle-end expects the front-end to either call build_common_tree_nodes
or to provide the *equivalent* functionality itself.  :>

Roger
--



More information about the Gcc-patches mailing list