Struct rupta::graph::pag::PAG

source ·
pub struct PAG<P: PAGPath> { /* private fields */ }

Implementations§

source§

impl<P: PAGPath> PAG<P>

source

pub fn new() -> Self

Constructor

source

pub fn graph(&self) -> &Graph<PAGNode<P>, PAGEdge>

Returns a reference to the pag graph.

source

pub fn addr_edge_iter(&self) -> IterCopied<PAGEdgeId>

Return an iterator for the address_of edges.

source

pub fn node_path(&self, node_id: PAGNodeId) -> &P

Returns the path for the given node_id.

source

pub fn get_node(&self, node_id: PAGNodeId) -> &PAGNode<P>

Returns the node for the given node_id.

source

pub fn get_node_mut(&mut self, node_id: PAGNodeId) -> &mut PAGNode<P>

Returns the node for the given node_id.

source

pub fn get_node_id(&self, path: &P) -> Option<PAGNodeId>

Returns the node_id for the given path.

source

pub fn get_edge(&self, edge_id: PAGEdgeId) -> &PAGEdge

Returns the edge for the given edge_id.

source

pub fn add_node(&mut self, path: P)

Adds a new node to the pag.

source

pub fn get_or_insert_node(&mut self, path: &P) -> PAGNodeId

Helper function to get a node or insert a new node if it does not exist in the map.

source

pub fn has_edge(&self, src: &P, dst: &P, kind: &PAGEdgeEnum) -> bool

Returns true if the edge from src to dst of the kind exists.

source

pub fn contains_edge( &self, src: PAGNodeId, dst: PAGNodeId, kind: &PAGEdgeEnum ) -> bool

Returns true if the edge from src to dst of the kind exists.

source

pub fn add_incoming_addr_edge(&mut self, node_id: PAGNodeId, in_edge: PAGEdgeId)

source

pub fn add_outgoing_addr_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_incoming_direct_edge( &mut self, node_id: PAGNodeId, in_edge: PAGEdgeId )

source

pub fn add_outgoing_direct_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_incoming_load_edge(&mut self, node_id: PAGNodeId, in_edge: PAGEdgeId)

source

pub fn add_outgoing_load_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_incoming_store_edge( &mut self, node_id: PAGNodeId, in_edge: PAGEdgeId )

source

pub fn add_outgoing_store_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_incoming_gep_edge(&mut self, node_id: PAGNodeId, in_edge: PAGEdgeId)

source

pub fn add_outgoing_gep_edge(&mut self, node_id: PAGNodeId, out_edge: PAGEdgeId)

source

pub fn add_incoming_cast_edge(&mut self, node_id: PAGNodeId, in_edge: PAGEdgeId)

source

pub fn add_outgoing_cast_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_incoming_offset_edge( &mut self, node_id: PAGNodeId, in_edge: PAGEdgeId )

source

pub fn add_outgoing_offset_edge( &mut self, node_id: PAGNodeId, out_edge: PAGEdgeId )

source

pub fn add_edge( &mut self, src: &P, dst: &P, kind: PAGEdgeEnum ) -> Option<PAGEdgeId>

Adds an edge from src to dst according to the edge type. Returns the edge id if this edge is newly added to the graph.

source

pub fn add_addr_edge(&mut self, src: &P, dst: &P) -> Option<PAGEdgeId>

source

pub fn add_direct_edge(&mut self, src: &P, dst: &P) -> Option<PAGEdgeId>

source

pub fn add_load_edge( &mut self, src: &P, dst: &P, kind: PAGEdgeEnum ) -> Option<PAGEdgeId>

source

pub fn add_store_edge( &mut self, src: &P, dst: &P, kind: PAGEdgeEnum ) -> Option<PAGEdgeId>

source

pub fn add_gep_edge( &mut self, src: &P, dst: &P, kind: PAGEdgeEnum ) -> Option<PAGEdgeId>

source

pub fn add_cast_edge(&mut self, src: &P, dst: &P) -> Option<PAGEdgeId>

source

pub fn add_offset_edge(&mut self, src: &P, dst: &P) -> Option<PAGEdgeId>

source

pub fn add_new_direct_edges<'tcx>( &mut self, acx: &mut AnalysisContext<'tcx, '_>, src: &P, dst: &P, ty: Ty<'tcx> ) -> Vec<PAGEdgeId>

Given two paths, add direct edge between them if they are both of pointer type or add direct edges between their pointer type fields if any. Return the edges added.

source

pub fn get_func_pag(&self, func_id: &FuncId) -> Option<&FuncPAG>

source

pub fn build_func_pag( &mut self, acx: &mut AnalysisContext<'_, '_>, func_id: FuncId ) -> bool

source

pub fn build_static_pag( &mut self, acx: &mut AnalysisContext<'_, '_>, def_id: DefId ) -> Option<FuncId>

source

pub fn promote_constants<'tcx>( &mut self, acx: &mut AnalysisContext<'tcx, '_>, def_id: DefId, gen_args: &Vec<GenericArgE<'tcx>> ) -> Option<HashSet<FuncId>>

source§

impl<P: PAGPath> PAG<P>
where P::FuncTy: Into<FuncId> + Copy,

source

pub fn add_inter_procedural_edges( &mut self, acx: &mut AnalysisContext<'_, '_>, callsite: &CallSiteS<P::FuncTy, P>, callee: P::FuncTy ) -> Vec<PAGEdgeId>

Adds direct edges from the arguments to the parameters and from the return value to the destination value.

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for PAG<P>
where P: RefUnwindSafe,

§

impl<P> !Send for PAG<P>

§

impl<P> !Sync for PAG<P>

§

impl<P> Unpin for PAG<P>
where P: Unpin,

§

impl<P> UnwindSafe for PAG<P>
where P: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.