Skip to content

Commit

Permalink
[multicore] thread safe missing dependencies
Browse files Browse the repository at this point in the history
Summary: As per title.

Reviewed By: geralt-encore

Differential Revision:
D67969601

Privacy Context Container: L1208441

fbshipit-source-id: 41c1c65f8298f5332c446fc9ea877c0e444433e0
  • Loading branch information
ngorogiannis authored and facebook-github-bot committed Jan 9, 2025
1 parent fc1daaa commit 24b82d4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions infer/src/IR/MissingDependencies.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,19 @@ let load () =
{procedures; sources}


let mutex = Error_checking_mutex.create ()

let missing_deps = {procedures= ProcUidSet.create 1; sources= SourceFile.HashSet.create 1}

let get () = missing_deps
let get () = Error_checking_mutex.critical_section mutex ~f:(fun () -> missing_deps)

let record_procname callee =
if Config.log_missing_deps && not (BuiltinDecl.is_declared callee) then
ProcUidSet.add (Procname.to_unique_id callee) missing_deps.procedures
Error_checking_mutex.critical_section mutex ~f:(fun () ->
ProcUidSet.add (Procname.to_unique_id callee) missing_deps.procedures )


let record_sourcefile sourcefile =
if Config.log_missing_deps then SourceFile.HashSet.add sourcefile missing_deps.sources
if Config.log_missing_deps then
Error_checking_mutex.critical_section mutex ~f:(fun () ->
SourceFile.HashSet.add sourcefile missing_deps.sources )

0 comments on commit 24b82d4

Please sign in to comment.