Struct RapCallback

Source
pub struct RapCallback {
Show 15 fields pub(crate) alias: bool, pub(crate) api_dependency: bool, pub(crate) callgraph: bool, pub(crate) dataflow: usize, pub(crate) ownedheap: bool, pub(crate) range: usize, pub(crate) ssa: bool, pub(crate) test: bool, pub(crate) infer: bool, pub(crate) opt: usize, pub(crate) rcanary: bool, pub(crate) safedrop: bool, pub(crate) show_mir: bool, pub(crate) unsafety_isolation: usize, pub(crate) verify: bool,
}
Expand description

This is the data structure to handle rapx options as a rustc callback.

Fields§

§alias: bool§api_dependency: bool§callgraph: bool§dataflow: usize§ownedheap: bool§range: usize§ssa: bool§test: bool§infer: bool§opt: usize§rcanary: bool§safedrop: bool§show_mir: bool§unsafety_isolation: usize§verify: bool

Implementations§

Source§

impl RapCallback

Source

pub fn enable_alias(&mut self, arg: String)

Enable alias analysis. The parameter is used to config the threshold of alias analysis. Currently, we mainly use it to control the depth of field-sensitive analysis. -alias0: set field depth limit to 10; do not distinguish different flows within a each strongly-connected component. -alias1: set field depth limit to 20 (this is default setting). -alias2: set field depth limit to 30.

Source

pub fn is_alias_enabled(&self) -> bool

Test if alias analysis is enabled.

Source

pub fn enable_api_dependency(&mut self)

Enable API-dependency graph generation.

Source

pub fn is_api_dependency_enabled(self) -> bool

Test if API-dependency graph generation is enabled.

Source

pub fn enable_callgraph(&mut self)

Enable call-graph analysis.

Source

pub fn is_callgraph_enabled(&self) -> bool

Test if call-graph analysis is enabled.

Source

pub fn enable_ownedheap(&mut self)

Enable owned heap analysis.

Source

pub fn is_ownedheap_enabled(self) -> bool

Test if owned-heap analysis is enabled.

Source

pub fn enable_dataflow(&mut self, x: usize)

Enable dataflow analysis.

Source

pub fn is_dataflow_enabled(self) -> usize

Test if dataflow analysis is enabled.

Source

pub fn enable_range_analysis(&mut self, x: usize)

Enable range analysis.

Source

pub fn is_range_analysis_enabled(self) -> bool

Test if range analysis is enabled.

Source

pub fn enable_test(&mut self)

Enable test of features provided by the core analysis traits.

Source

pub fn is_test_enabled(self) -> bool

Check if test is enabled.

Source

pub fn enable_ssa_transform(&mut self)

Enable ssa transformation

Source

pub fn is_ssa_transform_enabled(self) -> bool

Test if ssa transformation is enabled.

Source

pub fn enable_opt(&mut self, x: usize)

Enable optimization analysis for performance bug detection.

Source

pub fn is_opt_enabled(self) -> usize

Test if optimization analysis is enabled.

Source

pub fn enable_rcanary(&mut self)

Enable rcanary for memory leakage detection.

Source

pub fn is_rcanary_enabled(&self) -> bool

Test if rcanary is enabled.

Source

pub fn enable_safedrop(&mut self, arg: String)

Enable safedrop for use-after-free bug detection. Similar to alias analysis, the second parameter is to control the depth threshold for field-sensitive analysis.

Source

pub fn is_safedrop_enabled(&self) -> bool

Test if safedrop is enabled.

Source

pub fn enable_show_mir(&mut self)

Enable mir display.

Source

pub fn is_show_mir_enabled(&self) -> bool

Test if mir display is enabled.

Source

pub fn enable_unsafety_isolation(&mut self, x: usize)

Source

pub fn is_unsafety_isolation_enabled(&self) -> usize

Source

pub fn enable_verify(&mut self)

Source

pub fn is_verify_enabled(&self) -> bool

Source

pub fn enable_infer(&mut self)

Source

pub fn is_infer_enabled(&self) -> bool

Trait Implementations§

Source§

impl Callbacks for RapCallback

Source§

fn config(&mut self, config: &mut Config)

Called before creating the compiler instance
Source§

fn after_crate_root_parsing( &mut self, _compiler: &Compiler, _krate: &mut Crate, ) -> Compilation

Called after parsing the crate root. Submodules are not yet parsed when this callback is called. Return value instructs the compiler whether to continue the compilation afterwards (defaults to Compilation::Continue)
Source§

fn after_analysis<'tcx>( &mut self, _compiler: &Compiler, tcx: TyCtxt<'tcx>, ) -> Compilation

Called after analysis. Return value instructs the compiler whether to continue the compilation afterwards (defaults to Compilation::Continue)
Source§

fn after_expansion<'tcx>( &mut self, _compiler: &Compiler, _tcx: TyCtxt<'tcx>, ) -> Compilation

Called after expansion. Return value instructs the compiler whether to continue the compilation afterwards (defaults to Compilation::Continue)
Source§

impl Clone for RapCallback

Source§

fn clone(&self) -> RapCallback

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RapCallback

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RapCallback

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Hash for RapCallback

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Copy for RapCallback

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.