This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Creating temporary variables
- From: Ian Lance Taylor <ian at airs dot com>
- To: VIbhav Garg <vibhtech at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 20 Nov 2005 19:36:32 -0800
- Subject: Re: Creating temporary variables
- References: <4380D7B8.1080603@yahoo.com>
VIbhav Garg <vibhtech@yahoo.com> writes:
> I am working on some optimizations on the CFG. Can someone please give
> me some info on the following -
>
> 1. For an gimple expression node, how do we determine the return type?
You can get the type of any gimple expression using TREE_TYPE.
> 2. How do we create a temporary variable, and add it to the list of
> variables defined in the current function declaration?
create_tmp_var.
> 3. Any particular code I can look at to see how it works.
grep for create_tmp_var.
> 4. Any issues I should be aware of?
It kinds of depends on when during the compilation you are doing this.
When in SSA form you probably need to do other stuff as well.
Ian