keep track of string representation of floating point constants
commite6ac6509bcc869d2e2b7e931199200304c2adf27
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 24 Dec 2012 11:04:53 +0000 (24 12:04 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 26 Dec 2012 20:01:06 +0000 (26 21:01 +0100)
tree95c20dd04da0f48b49b25dccf1ece201d0f3099b
parente0dc893bbc7e133390aa3e5e5905e705940066f6
keep track of string representation of floating point constants

The double value currently stored is only approximate and doesn't keep
track of whether the constant is of type float or double.
Printing the double value using the %g format specifier may also lose
the decimal point.

We solve these problems by saving the original representation
in the source code as a string in the corresponding pet_expr,
provided no macros are involved.  Otherwise, we use
clang's pretty printer to print the constant to a string.

Requested-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
configure.ac
emit.c
include/pet.h
parse.c
scan.cc
scop.c
scop.h
tests/float.c [new file with mode: 0644]
tests/float.scop [new file with mode: 0644]