Skip to content

Commit

Permalink
Fix -D dump-dependencies (#11669)
Browse files Browse the repository at this point in the history
* Fix -D dump-dependencies

* Dump dependencies: highlight dependencies from different context

* Use mdep.md_kind instead of signature
  • Loading branch information
kLabz authored May 15, 2024
1 parent d9791f6 commit 7675bb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/codegen/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,14 @@ module Dump = struct
List.iter (fun m ->
print "%s:\n" (Path.UniqueKey.lazy_path m.m_extra.m_file);
PMap.iter (fun _ mdep ->
let m2 = com.module_lut#find mdep.md_path in
let (ctx,m2) = match mdep.md_kind with
| MMacro when not com.is_macro_context ->
("[macro] ", (Option.get (com.get_macros())).module_lut#find mdep.md_path)
| _ ->
("", com.module_lut#find mdep.md_path)
in
let file = Path.UniqueKey.lazy_path m2.m_extra.m_file in
print "\t%s\n" file;
print "\t%s%s\n" ctx file;
let l = try Hashtbl.find dep file with Not_found -> [] in
Hashtbl.replace dep file (m :: l)
) m.m_extra.m_deps;
Expand Down

0 comments on commit 7675bb2

Please sign in to comment.