pub struct BodyVisitor<'tcx> {Show 13 fields
pub tcx: TyCtxt<'tcx>,
pub def_id: DefId,
pub safedrop_graph: SafeDropGraph<'tcx>,
pub abstract_states: HashMap<usize, PathInfo<'tcx>>,
pub unsafe_callee_report: HashMap<String, usize>,
pub local_ty: HashMap<usize, PlaceTy<'tcx>>,
pub visit_time: usize,
pub check_results: Vec<CheckResult>,
pub generic_map: HashMap<String, HashSet<Ty<'tcx>>>,
pub global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>,
pub proj_ty: HashMap<usize, Ty<'tcx>>,
pub chains: DominatedGraph<'tcx>,
pub paths: Vec<Vec<usize>>,
}
Fields§
§tcx: TyCtxt<'tcx>
§def_id: DefId
§safedrop_graph: SafeDropGraph<'tcx>
§abstract_states: HashMap<usize, PathInfo<'tcx>>
§unsafe_callee_report: HashMap<String, usize>
§local_ty: HashMap<usize, PlaceTy<'tcx>>
§visit_time: usize
§check_results: Vec<CheckResult>
§generic_map: HashMap<String, HashSet<Ty<'tcx>>>
§global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>
§proj_ty: HashMap<usize, Ty<'tcx>>
§chains: DominatedGraph<'tcx>
§paths: Vec<Vec<usize>>
Implementations§
source§impl<'tcx> BodyVisitor<'tcx>
impl<'tcx> BodyVisitor<'tcx>
pub fn new( tcx: TyCtxt<'tcx>, def_id: DefId, global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>, visit_time: usize, ) -> Self
pub fn get_ty_by_place(&self, p: usize) -> Ty<'tcx>
pub fn path_forward_check(&mut self, fn_map: &FnMap)
pub fn path_analyze_block( &mut self, block: &BasicBlockData<'tcx>, path_index: usize, bb_index: usize, fn_map: &FnMap, )
pub fn path_analyze_terminator( &mut self, terminator: &Terminator<'tcx>, path_index: usize, bb_index: usize, fn_map: &FnMap, )
pub fn path_analyze_statement( &mut self, statement: &Statement<'tcx>, _path_index: usize, )
pub fn path_analyze_assign( &mut self, lplace: &Place<'tcx>, rvalue: &Rvalue<'tcx>, path_index: usize, )
pub fn handle_call( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, fn_map: &FnMap, fn_span: Span, )
pub fn handle_ret_alias( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, fn_map: &FnMap, args: &Box<[Spanned<Operand<'_>>]>, )
pub fn update_post_state( &mut self, post_state: &HashMap<usize, AbstractStateItem<'tcx>>, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, )
pub fn get_args_post_states( &mut self, ) -> HashMap<usize, AbstractStateItem<'tcx>>
pub fn get_all_paths(&mut self) -> Vec<Vec<usize>>
pub fn abstract_states_mop(&mut self) -> PathInfo<'tcx>
pub fn abstate_debug(&self)
pub fn update_callee_report_level( &mut self, unsafe_callee: String, report_level: usize, )
pub fn output_results(&self, threshold: usize)
pub fn insert_path_abstate( &mut self, path_index: usize, place: usize, abitem: AbstractStateItem<'tcx>, )
pub fn get_layout_by_place_usize(&self, place: usize) -> PlaceTy<'tcx>
pub fn visit_ty_and_get_layout(&self, ty: Ty<'tcx>) -> PlaceTy<'tcx>
pub fn get_abstate_by_place_in_path( &self, place: usize, path_index: usize, ) -> AbstractStateItem<'tcx>
pub fn handle_cast( &mut self, rpjc_local: usize, lpjc_local: usize, ty: &Ty<'tcx>, path_index: usize, cast_kind: &CastKind, )
pub fn handle_binary_op( &mut self, first_op: &Operand<'_>, bin_op: &BinOp, second_op: &Operand<'_>, path_index: usize, )
pub fn handle_operand(&self, op: &Operand<'_>) -> usize
pub fn get_proj_ty(&self, place: usize) -> Option<Ty<'tcx>>
pub fn handle_proj(&mut self, is_right: bool, place: Place<'tcx>) -> usize
source§impl<'tcx> BodyVisitor<'tcx>
impl<'tcx> BodyVisitor<'tcx>
pub fn handle_std_unsafe_call( &mut self, _dst_place: &Place<'_>, def_id: &DefId, args: &Box<[Spanned<Operand<'_>>]>, _path_index: usize, _fn_map: &FnMap, fn_span: Span, fn_result: UnsafeApi, )
pub fn insert_failed_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )
pub fn insert_successful_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )
pub fn check_align(&self, arg: usize) -> bool
pub fn check_non_zst(&self, arg: usize) -> bool
pub fn check_typed(&self, _arg: usize) -> bool
pub fn check_non_null(&self, arg: usize) -> bool
pub fn check_allocator_consistency(&self, _arg: usize) -> bool
pub fn check_allocated(&self, _arg: usize) -> bool
pub fn check_inbounded(&self, _arg: usize) -> bool
pub fn check_valid_string(&self, _arg: usize) -> bool
pub fn check_valid_cstr(&self, _arg: usize) -> bool
pub fn check_valid_int(&self, _arg: usize) -> bool
pub fn check_init(&self, _arg: usize) -> bool
pub fn check_valid_ptr(&self, arg: usize) -> bool
pub fn check_deref(&self, arg: usize) -> bool
pub fn check_ref_to_ptr(&self, arg: usize) -> bool
Auto Trait Implementations§
impl<'tcx> Freeze for BodyVisitor<'tcx>
impl<'tcx> !RefUnwindSafe for BodyVisitor<'tcx>
impl<'tcx> !Send for BodyVisitor<'tcx>
impl<'tcx> !Sync for BodyVisitor<'tcx>
impl<'tcx> Unpin for BodyVisitor<'tcx>
impl<'tcx> !UnwindSafe for BodyVisitor<'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more