forked from Artisan-Lab/RAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use lazy_static::lazy_static; | ||
use rustc_hir::def_id::DefId; | ||
use std::{collections::HashMap, sync::Mutex}; | ||
|
||
use super::contracts::abstract_state::AbstractStateItem; | ||
|
||
lazy_static! { | ||
pub static ref GLOBAL_INTER_RECORDER: Mutex<HashMap<DefId, InterAnalysisRecord>> = | ||
Mutex::new(HashMap::new()); | ||
} | ||
// static mut GLOBAL_INTER_RECORDER: HashMap<DefId,InterAnalysisRecord> = HashMap::new(); | ||
|
||
pub struct InterAnalysisRecord { | ||
pub pre_analysis_state: HashMap<usize, AbstractStateItem>, | ||
pub post_analysis_state: HashMap<usize, AbstractStateItem>, | ||
} | ||
|
||
impl InterAnalysisRecord { | ||
pub fn new( | ||
pre_analysis_state: HashMap<usize, AbstractStateItem>, | ||
post_analysis_state: HashMap<usize, AbstractStateItem>, | ||
) -> Self { | ||
Self { | ||
pre_analysis_state, | ||
post_analysis_state, | ||
} | ||
} | ||
|
||
pub fn is_pre_state_same(&self, other_pre_state: &HashMap<usize, AbstractStateItem>) -> bool { | ||
self.pre_analysis_state == *other_pre_state | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters