summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2014-05-07 00:34:20 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2014-05-07 00:34:20 +0000
commit1ce29d9bfca4e5f8a6f76c8f1d04521abc2dafc6 (patch)
treebc9cf016ae76d9191fa4b02ac83cf4239e2f93d6 /tools
parent3dd57a94e308eb8222b09da3b939667b9773ccf4 (diff)
downloadocaml-1ce29d9bfca4e5f8a6f76c8f1d04521abc2dafc6.tar.gz
re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools')
-rw-r--r--tools/objinfo.ml13
-rw-r--r--tools/read_cmt.ml11
2 files changed, 19 insertions, 5 deletions
diff --git a/tools/objinfo.ml b/tools/objinfo.ml
index 0eb33882a0..3eaafcca73 100644
--- a/tools/objinfo.ml
+++ b/tools/objinfo.ml
@@ -34,8 +34,15 @@ let input_stringlist ic len =
let sect = really_input_string ic len in
get_string_list sect len
-let print_name_crc (name, crc) =
- printf "\t%s\t%s\n" (Digest.to_hex crc) name
+let dummy_crc = String.make 32 '-'
+
+let print_name_crc (name, crco) =
+ let crc =
+ match crco with
+ None -> dummy_crc
+ | Some crc -> Digest.to_hex crc
+ in
+ printf "\t%s\t%s\n" crc name
let print_line name =
printf "\t%s\n" name
@@ -143,7 +150,7 @@ let dump_byte ic =
| "CRCS" ->
p_section
"Imported units"
- (input_value ic : (string * Digest.t) list)
+ (input_value ic : (string * Digest.t option) list)
| "DLLS" ->
p_list
"Used DLLs"
diff --git a/tools/read_cmt.ml b/tools/read_cmt.ml
index 0ff9f3df77..eacba02a50 100644
--- a/tools/read_cmt.ml
+++ b/tools/read_cmt.ml
@@ -27,6 +27,8 @@ let arg_list = [
let arg_usage =
"read_cmt [OPTIONS] FILE.cmt : read FILE.cmt and print related information"
+let dummy_crc = String.make 32 '-'
+
let print_info cmt =
let open Cmt_format in
Printf.printf "module name: %s\n" cmt.cmt_modname;
@@ -60,8 +62,13 @@ let print_info cmt =
| Some digest ->
Printf.printf "interface digest: %s\n" (Digest.to_hex digest);
end;
- List.iter (fun (name, digest) ->
- Printf.printf "import: %s %s\n" name (Digest.to_hex digest);
+ List.iter (fun (name, crco) ->
+ let crc =
+ match crco with
+ None -> dummy_crc
+ | Some crc -> Digest.to_hex crc
+ in
+ Printf.printf "import: %s %s\n" name crc;
) (List.sort compare cmt.cmt_imports);
Printf.printf "%!";
()