Skip to content

Commit

Permalink
Add maylocksdigest analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 30, 2023
1 parent 8e557ca commit 87e86ed
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions src/analyses/mayLocksDigest.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(** May lockset digest analysis ([maylocksdigest]). *)

open Analyses
open GoblintCil
module LF = LibraryFunctions

module Arg:LocksetAnalysis.MayArg =
struct
module D = LockDomain.MayLocksetNoRW
module P = IdentityP (D)
module G = DefaultSpec.G
module V = DefaultSpec.V

let add ctx (l,r) =
D.add l ctx.local

let remove ctx l =
ctx.local
end

module Spec =
struct
include LocksetAnalysis.MakeMay (Arg)
let name () = "maylocksdigest"

let threadenter ctx ~multiple lval f args = [ctx.local]
end

let _ =
MCP.register_analysis ~dep:["mutexEvents"] (module Spec : MCPSpec)
2 changes: 1 addition & 1 deletion tests/regression/46-apron2/58-lock-digest.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] apron --set ana.relation.privatization mutex-meet
// PARAM: --set ana.activated[+] apron --set ana.relation.privatization mutex-meet --set ana.activated[+] maylocksdigest --set ana.path_sens[+] maylocksdigest
#include <pthread.h>
#include <goblint.h>

Expand Down

0 comments on commit 87e86ed

Please sign in to comment.