This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: how to get value of real constant in .tu file
- From: James Michael DuPont <mdupont777 at yahoo dot com>
- To: sushilpage at yahoo dot co dot in
- Cc: gcc at gnu dot org
- Date: Tue, 15 Oct 2002 09:17:13 -0700 (PDT)
- Subject: RE: how to get value of real constant in .tu file
Sushil,
The TU files are the same as used by me in the introspector patch,
Except that I output them into XML.
I will attempt at answering this request.
(Note, I am looking at the ast-optimizer-branch here )
The code in tree-dump.c that produces integers is here :
------------------------------------------------------------
case INTEGER_CST:
if (TREE_INT_CST_HIGH (t))
dump_int (di, "high", TREE_INT_CST_HIGH (t));
dump_int (di, "low", TREE_INT_CST_LOW (t));
break;
------------------------------------------------------------
Now, examining this code shows that there is not any handlers for
real_cst, but in the modules print-tree.c (for debugging output)
------------------------------------------------------------
case REAL_CST:
{
REAL_VALUE_TYPE d;
if (TREE_OVERFLOW (node))
fprintf (file, " overflow");
d = TREE_REAL_CST (node);
if (REAL_VALUE_ISINF (d))
fprintf (file, " Inf");
else if (REAL_VALUE_ISNAN (d))
fprintf (file, " Nan");
else
{
char string[100];
REAL_VALUE_TO_DECIMAL (d, "%e", string);
fprintf (file, " %s", string);
}
}
break;
------------------------------------------------------------
I can imagine that it would be pretty simple to include this
code back into the tree dumper.
Hope that helps,
Mike
=====
James Michael DuPont
http://introspector.sourceforge.net/
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com