How rustanlys/rupta works
RUPTA analyzes Rust MIR to compute pointer/alias information and call graphs. The user selects a project or single-file entry point and analysis options; the framework initializes compiler analysis, discovers reachable functions, builds graph constraints, runs Andersen or callsite-sensitive propagation, and can dump call-graph and points-to results. The graph preserves context strategies, stack filtering, precision-critical function analysis, and shared analysis data. Unsampled implementation details are represented only where the README or SOURCE INDEX supports them.
Main entry points: context_sensitive.rs Context-sensitive analysis · mod.rs Analysis framework · fpag_builder.rs Function PAG builder · andersen.rs Andersen analysis
Components 24
Entry and setup
- Project CLI
src/bin/cargo-pta.rs - Single-file CLI
src/bin/pta.rs - Analysis framework
src/pta/mod.rs
Function discovery
- Reachability analysis
src/pre_analysis/rta/rta.rs - MIR body visitor
src/pre_analysis/rta/body_visitor.rs - Precision-critical functions
src/pre_analysis/precision_critical_func_identification/precision_critical_func_identification.rs - Function pointer flow
src/pre_analysis/precision_critical_func_identification/func_pointer_flow_analysis.rs
Graph construction
- Call graph builder
src/builder/call_graph_builder.rs - Function PAG builder
src/builder/fpag_builder.rs - Special function handling
src/builder/special_function_handler.rs - Substitution specializer
src/builder/substs_specializer.rs - Call graph
src/graph/call_graph.rs - Pointer assignment graph
src/graph/pag.rs - Function PAG
src/graph/func_pag.rs
Pointer analysis
- Andersen analysis
src/pta/andersen.rs - Context-sensitive analysis
src/pta/context_sensitive.rs - Context strategy
src/pta/strategies/context_strategy.rs - Stack filtering
src/pta/strategies/stack_filtering.rs - Constraint propagator
src/pta/propagator/propagator.rs
Results and data
- MIR analysis context
src/mir/analysis_context.rs - Points-to sets
src/pts_set/points_to.rs - Result dumper
src/util/results_dumper.rs
Other components
- Rust project or file
- Call graph and points-to output
Connections 28
- Rust project or file → Project CLI: analyze project
README.md - Rust project or file → Single-file CLI: analyze file
README.md - Project CLI → Analysis framework: launches analysis
- Single-file CLI → Analysis framework: launches analysis
- Analysis framework → MIR analysis context: initializes context
src/pta/mod.rs - Analysis framework → Andersen analysis: selects algorithm
src/pta/mod.rs - Analysis framework → Context-sensitive analysis: selects algorithm
src/pta/mod.rs - Reachability analysis → Call graph builder: resolves callees
src/pre_analysis/rta/rta.rs - Reachability analysis → Call graph: records reachability
src/pre_analysis/rta/rta.rs - MIR body visitor → Reachability analysis: visits function bodies
src/pre_analysis/rta/body_visitor.rs - Precision-critical functions → Function pointer flow: analyzes pointer flow
src/pre_analysis/precision_critical_func_identification/precision_critical_func_identification.rs - Precision-critical functions → Reachability analysis: uses reachability
src/pre_analysis/precision_critical_func_identification/precision_critical_func_identification.rs - Function PAG builder → Pointer assignment graph: builds constraints
src/builder/fpag_builder.rs - Function PAG builder → Function PAG: constructs function graph
src/builder/fpag_builder.rs - Function PAG builder → Special function handling: handles special calls
src/builder/fpag_builder.rs - Function PAG builder → Substitution specializer: specializes substitutions
src/builder/fpag_builder.rs - Pointer assignment graph → Function PAG: stores function graphs
src/graph/pag.rs - Andersen analysis → Constraint propagator: runs propagation
src/pta/andersen.rs - Context-sensitive analysis → Constraint propagator: runs propagation
src/pta/context_sensitive.rs - Context-sensitive analysis → Context strategy: selects contexts
src/pta/context_sensitive.rs - Context-sensitive analysis → Precision-critical functions: uses precision analysis
src/pta/context_sensitive.rs - Andersen analysis → Stack filtering: applies filtering
src/pta/andersen.rs - Context-sensitive analysis → Stack filtering: applies filtering
src/pta/context_sensitive.rs - Constraint propagator → Pointer assignment graph: reads constraints
src/pta/propagator/propagator.rs - Constraint propagator → Points-to sets: updates sets
src/pta/propagator/propagator.rs - Andersen analysis → Result dumper: dumps results
src/pta/andersen.rs - Context-sensitive analysis → Result dumper: dumps results
src/pta/context_sensitive.rs - Result dumper → Call graph and points-to output: writes results
README.md