start refactor inst struct
This commit is contained in:
parent
c3a7762fc8
commit
af24c7070a
2 changed files with 1205 additions and 389 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +1,8 @@
|
|||
//! The visitor trait and common implementations.
|
||||
|
||||
use crate::{
|
||||
ins::Instruction, DexString, IdEnum, IdField, IdMethod, IdMethodType, IdType, MethodHandle,
|
||||
Result,
|
||||
ins::Instruction, CallSite, DexString, IdEnum, IdField, IdMethod, IdMethodType, IdType,
|
||||
MethodHandle, Result,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
|
@ -31,6 +31,9 @@ pub trait Visitor: Sized {
|
|||
fn visit_method_handle(&mut self, handle: &MethodHandle) -> Result<()> {
|
||||
handle.default_visit(self)
|
||||
}
|
||||
fn visit_call_site(&mut self, site: &CallSite) -> Result<()> {
|
||||
site.default_visit(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait VisitorMut: Sized {
|
||||
|
|
@ -58,6 +61,9 @@ pub trait VisitorMut: Sized {
|
|||
fn visit_method_handle(&mut self, handle: MethodHandle) -> Result<MethodHandle> {
|
||||
handle.default_visit_mut(self)
|
||||
}
|
||||
fn visit_call_site(&mut self, site: CallSite) -> Result<CallSite> {
|
||||
site.default_visit_mut(self)
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for structures that can be visited.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue