MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / apply_gen_kill

Method apply_gen_kill

src/detector/lock/mod.rs:510–529  ·  view source on GitHub ↗

state' = state \ kill U gen return lockguard relation(a, b) where a is still live when b becomes live.

(
        state: &mut LiveLockGuards,
        gen: Option<&LiveLockGuards>,
        kill: Option<&LiveLockGuards>,
    )

Source from the content-addressed store, hash-verified

508 /// Collect gen/kill info for related locations.
509 fn gen_kill_locations(
510 lockguard_map: &LockGuardMap<'tcx>,
511 ) -> (
512 FxHashMap<Location, LiveLockGuards>,
513 FxHashMap<Location, LiveLockGuards>,
514 ) {
515 let mut gen_map: FxHashMap<Location, LiveLockGuards> = Default::default();
516 let mut kill_map: FxHashMap<Location, LiveLockGuards> = Default::default();
517 for (id, info) in lockguard_map {
518 for loc in &info.gen_locs {
519 gen_map.entry(*loc).or_default().insert(*id);
520 }
521 for loc in &info.kill_locs {
522 kill_map.entry(*loc).or_default().insert(*id);
523 }
524 }
525 (gen_map, kill_map)
526 }
527
528 /// state' = state \ kill U gen
529 /// return lockguard relation(a, b) where a is still live when b becomes live.
530 fn apply_gen_kill(
531 state: &mut LiveLockGuards,
532 gen: Option<&LiveLockGuards>,

Callers

nothing calls this directly

Calls 4

difference_in_placeMethod · 0.80
raw_lockguard_idsMethod · 0.80
insertMethod · 0.80
union_in_placeMethod · 0.80

Tested by

no test coverage detected