diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-03-07 17:49:18 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-03-07 17:49:18 +0000 |
commit | c24a652789e15b33153c1d90c6869eb6e6e28040 (patch) | |
tree | e5e5aa2767fe098e3b23f82091ff6d60b0c6d8f2 /powerpc/PrintAsm.ml | |
parent | 6a8503115a9952dc793d15d0ea9033b68b30aae6 (diff) | |
download | compcert-c24a652789e15b33153c1d90c6869eb6e6e28040.tar.gz compcert-c24a652789e15b33153c1d90c6869eb6e6e28040.zip |
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
Diffstat (limited to 'powerpc/PrintAsm.ml')
-rw-r--r-- | powerpc/PrintAsm.ml | 21 |
1 files changed, 4 insertions, 17 deletions
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), _)) = |