From 6a8f9945403c4856ad94b115f6bcc229e79bc492 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 12 Jan 2014 14:11:30 +0000 Subject: 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 --- cfrontend/PrintClight.ml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cfrontend/PrintClight.ml') 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, _) -> -- cgit