Forráskód Böngészése

Fix -D dump-dependencies (#11669)

* Fix -D dump-dependencies

* Dump dependencies: highlight dependencies from different context

* Use mdep.md_kind instead of signature
Rudy Ges 1 éve
szülő
commit
7675bb26c7
1 módosított fájl, 7 hozzáadás és 2 törlés
  1. 7 2
      src/codegen/codegen.ml

+ 7 - 2
src/codegen/codegen.ml

@@ -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;