aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend/PrintClight.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-01-12 14:11:30 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-01-12 14:11:30 +0000
commit6a8f9945403c4856ad94b115f6bcc229e79bc492 (patch)
treecce76bc1d7c66e0ec9c707ad7f79ff3db812bd3b /cfrontend/PrintClight.ml
parent14f375f7b879d9ccfb06845b2dbe1a907851e330 (diff)
downloadcompcert-kvx-6a8f9945403c4856ad94b115f6bcc229e79bc492.tar.gz
compcert-kvx-6a8f9945403c4856ad94b115f6bcc229e79bc492.zip
Better printing of integer literals: add U and LL suffixes when needed.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2405 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/PrintClight.ml')
-rw-r--r--cfrontend/PrintClight.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/cfrontend/PrintClight.ml b/cfrontend/PrintClight.ml
index 376707a0..49705c46 100644
--- a/cfrontend/PrintClight.ml
+++ b/cfrontend/PrintClight.ml
@@ -76,10 +76,14 @@ let rec expr p (prec, e) =
fprintf p "*%a" expr (prec', a1)
| Efield(a1, f, _) ->
fprintf p "%a.%s" expr (prec', a1) (extern_atom f)
+ | Econst_int(n, Tint(I32, Unsigned, _)) ->
+ fprintf p "%luU" (camlint_of_coqint n)
| Econst_int(n, _) ->
fprintf p "%ld" (camlint_of_coqint n)
| Econst_float(f, _) ->
fprintf p "%F" (camlfloat_of_coqfloat f)
+ | Econst_long(n, Tlong(Unsigned, _)) ->
+ fprintf p "%LuLLU" (camlint64_of_coqint n)
| Econst_long(n, _) ->
fprintf p "%LdLL" (camlint64_of_coqint n)
| Eunop(Oabsfloat, a1, _) ->