This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: convert (long)round(d) -> lround(d), etc
- From: Roger Sayle <roger at eyesopen dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: schwab at suse dot de, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Apr 2004 10:18:29 -0600 (MDT)
- Subject: Re: [PATCH]: convert (long)round(d) -> lround(d), etc
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
--