diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-09 15:56:36 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-09 15:56:36 +0100 |
commit | 1269548f231e839da9e53647cac3b3efd1a9a389 (patch) | |
tree | 9ffb0c20ff853cf069ff21cd5e4e867bb98b06af | |
parent | 32205e08619fa8fce63caaf46a289d1868982a0a (diff) | |
download | compcert-kvx-1269548f231e839da9e53647cac3b3efd1a9a389.tar.gz compcert-kvx-1269548f231e839da9e53647cac3b3efd1a9a389.zip |
Use Printf.sprintf instead of Format.sprintf when possible
Minor performance tweak. Printf is more efficient for plain formats involving no boxes.
-rw-r--r-- | cparser/Elab.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 69830122..ea85ad04 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -835,7 +835,7 @@ and elab_struct_or_union_info keep_ty kind loc env members attrs = let m = List.flatten m in let m,_ = mmap (fun c fld -> if fld.fld_anonymous then - let name = Format.sprintf "<anon>_%d" c in + let name = Printf.sprintf "<anon>_%d" c in {fld with fld_name = name},c+1 else fld,c) 0 m in @@ -1103,11 +1103,11 @@ module I = struct let rec zipname = function | Ztop(name, ty) -> name | Zarray(z, ty, sz, dfl, before, idx, after) -> - Format.sprintf "%s[%Ld]" (zipname z) idx + Printf.sprintf "%s[%Ld]" (zipname z) idx | Zstruct(z, id, before, fld, after) -> - Format.sprintf "%s.%s" (zipname z) fld.fld_name + Printf.sprintf "%s.%s" (zipname z) fld.fld_name | Zunion(z, id, fld) -> - Format.sprintf "%s.%s" (zipname z) fld.fld_name + Printf.sprintf "%s.%s" (zipname z) fld.fld_name let name (z, i) = zipname z |