Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jul 18, 2023
1 parent 8935a14 commit 8c747ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/codegen/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ module Dump = struct
List.iter (fun m ->
print "%s:\n" (Path.UniqueKey.lazy_path m.m_extra.m_file);
PMap.iter (fun _ (sign,mpath) ->
let cc = com.cs#get_context sign in
let m2 = cc#find_module mpath in
let m2 = (com.cs#get_context sign)#find_module mpath in
let file = Path.UniqueKey.lazy_path m2.m_extra.m_file in
print "\t%s\n" file;
let l = try Hashtbl.find dep file with Not_found -> [] in
Expand Down
6 changes: 2 additions & 4 deletions src/compiler/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ let check_module sctx ctx m p =
in
let check_dependencies () =
PMap.iter (fun _ (sign,mpath) ->
let cc = com.cs#get_context sign in
let m2 = cc#find_module mpath in
let m2 = (com.cs#get_context sign)#find_module mpath in
match check m2 with
| None -> ()
| Some reason -> raise (Dirty (DependencyDirty(m2.m_path,reason)))
Expand Down Expand Up @@ -411,8 +410,7 @@ let add_modules sctx ctx m p =
TypeloadModule.ModuleLevel.add_module ctx m p;
PMap.iter (Hashtbl.replace com.resources) m.m_extra.m_binded_res;
PMap.iter (fun _ (sign,mpath) ->
let cc = com.cs#get_context sign in
let m2 = cc#find_module mpath in
let m2 = (com.cs#get_context sign)#find_module mpath in
add_modules (tabs ^ " ") m0 m2
) m.m_extra.m_deps
)
Expand Down
6 changes: 2 additions & 4 deletions src/context/memory.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ let rec scan_module_deps cs m h =
else begin
Hashtbl.add h m.m_id m;
PMap.iter (fun _ (sign,mpath) ->
let cc = cs#get_context sign in
let m = cc#find_module mpath in
let m = (cs#get_context sign)#find_module mpath in
scan_module_deps cs m h) m.m_extra.m_deps
end

Expand Down Expand Up @@ -276,8 +275,7 @@ let display_memory com =
if verbose then begin
print (Printf.sprintf " %d total deps" (List.length deps));
PMap.iter (fun _ (sign,mpath) ->
let cc = c#get_context sign in
let md = cc#find_module mpath in
let md = (com.cs#get_context sign)#find_module mpath in
print (Printf.sprintf " dep %s%s" (s_type_path mpath) (module_sign key md));
) m.m_extra.m_deps;
end;
Expand Down
4 changes: 2 additions & 2 deletions src/core/json/genjson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,10 @@ let generate_module cc m =
| MSBad reason -> Printer.s_module_skip_reason reason
| MSUnknown -> "Unknown");
"dependencies",jarray (PMap.fold (fun (_,mpath) acc ->
let m = cc#find_module mpath in
(jobject [
"path",jstring (s_type_path mpath);
"sign",jstring (Digest.to_hex m.m_extra.m_sign);
(* TODO handle modules from another context here *)
"sign",jstring (Digest.to_hex (cc#find_module mpath).m_extra.m_sign);
]) :: acc
) m.m_extra.m_deps []);
"dependents",jarray (List.map (fun m -> (jobject [
Expand Down

0 comments on commit 8c747ee

Please sign in to comment.