From c24a652789e15b33153c1d90c6869eb6e6e28040 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 7 Mar 2010 17:49:18 +0000 Subject: Handling of builtins, continued. PrintCsyntax, PrintAsm: improve printing of float literals. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1284 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- powerpc/PrintAsm.ml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'powerpc/PrintAsm.ml') diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml index a1e5afe3..d69d0aff 100644 --- a/powerpc/PrintAsm.ml +++ b/powerpc/PrintAsm.ml @@ -684,25 +684,12 @@ let print_init oc = function fprintf oc " .long %a\n" symbol_offset (symb, camlint_of_coqint ofs) -let print_init_char oc = function - | Init_int8 n -> - let c = Int32.to_int (camlint_of_coqint n) in - if c >= 32 && c <= 126 && c <> Char.code '\"' && c <> Char.code '\\' - then output_char oc (Char.chr c) - else fprintf oc "\\%03o" c - | _ -> - assert false - -let re_string_literal = Str.regexp "__stringlit_[0-9]+" - let print_init_data oc name id = - if Str.string_match re_string_literal (extern_atom name) 0 + if Str.string_match PrintCsyntax.re_string_literal (extern_atom name) 0 && List.for_all (function Init_int8 _ -> true | _ -> false) id - then begin - fprintf oc " .ascii \""; - List.iter (print_init_char oc) id; - fprintf oc "\"\n" - end else + then + fprintf oc " .ascii \"%s\"\n" (PrintCsyntax.string_of_init id) + else List.iter (print_init oc) id let print_var oc (Coq_pair(Coq_pair(name, init_data), _)) = -- cgit