diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-11 22:02:46 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-11 22:02:46 +0200 |
commit | 7299996cac6c4747b6611b17f0af15fb08c6ee80 (patch) | |
tree | 744b3f37834356ebb13c45097fc4740ffb4d16ea /common/PrintAST.ml | |
parent | 7d15566ad116730c1452364bc0fe3d2dc714e5ed (diff) | |
download | compcert-kvx-7299996cac6c4747b6611b17f0af15fb08c6ee80.tar.gz compcert-kvx-7299996cac6c4747b6611b17f0af15fb08c6ee80.zip |
fix reverse printing problem for hashes
Diffstat (limited to 'common/PrintAST.ml')
-rw-r--r-- | common/PrintAST.ml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/PrintAST.ml b/common/PrintAST.ml index e24607ee..38bbfa47 100644 --- a/common/PrintAST.ml +++ b/common/PrintAST.ml @@ -47,6 +47,13 @@ let name_of_chunk = function | Many32 -> "any32" | Many64 -> "any64" +let spp_profiling_id () (x : Digest.t) : string = + let s = Buffer.create 32 in + for i=0 to 15 do + Printf.bprintf s "%02x" (Char.code (String.get x i)) + done; + Buffer.contents s;; + let name_of_external = function | EF_external(name, sg) -> sprintf "extern %S" (camlstring_of_coqstring name) | EF_builtin(name, sg) -> sprintf "builtin %S" (camlstring_of_coqstring name) @@ -63,7 +70,7 @@ let name_of_external = function | EF_debug(kind, text, targs) -> sprintf "debug%d %S" (P.to_int kind) (extern_atom text) | EF_profiling(id, kind) -> - sprintf "profiling %a %d" Profilingaux.spp_id id (Z.to_int kind) + sprintf "profiling %a %d" spp_profiling_id id (Z.to_int kind) let rec print_builtin_arg px oc = function | BA x -> px oc x |