This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about modifing AST.
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- To: Eric Tang <tytang at cse dot cuhk dot edu dot hk>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 27 Oct 2002 18:37:48 +1100
- Subject: Re: Questions about modifing AST.
- References: <200210270510.g9R5AUb18155@solar1.cs.cuhk.hk>
On 27-Oct-2002, Eric Tang <tytang@cse.cuhk.edu.hk> wrote:
> i want to convert floating point to fixed point arithmetics
> in compiler level.
Why?
Are you talking about changing the language semantics?
Or are you just talking about a compiler optimization?
And for which language(s)?
> My approach (still thinking) is getting the AST from the gcc
> frontend,and then anaylse the necessary fixed-point notations
> to remove floating point operations. I modify the AST node with
> floating point to fixed-point and using gcc backend translate
> to binary.
If you want to do this, it's better to write a pass which operates
directly on GCC's AST representation, rather than trying to read
in the AST from the dump file (which won't work, IIUC, because the dump
file is deliberately incomplete).
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.