Skip to content

Commit

Permalink
analysis -> tag_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Medowhill committed May 16, 2024
1 parent ec07b00 commit 692a8d9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/bin/urcrat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ fn main() {
let arr = std::fs::read(file).unwrap();
points_to::deserialize_solutions(&arr)
});
let conf = analysis::Config {
let conf = tag_analysis::Config {
solutions,
unions: r#union.into_iter().collect(),
};
let start = std::time::Instant::now();
analysis::analyze_path(&file, &conf);
tag_analysis::analyze_path(&file, &conf);

if let Some(mut output) = output {
output.push(args.input.file_name().unwrap());
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ extern crate rustc_session;
extern crate rustc_span;

pub mod alloc_finder;
pub mod analysis;
pub mod andersen;
pub mod compile_util;
pub mod disjoint_set;
pub mod graph;
pub mod points_to;
pub mod relational;
pub mod steensgaard;
pub mod tag_analysis;
pub mod ty_finder;
pub mod ty_shape;
12 changes: 6 additions & 6 deletions src/relational/domains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_index::bit_set::{BitSet, HybridBitSet};
use rustc_middle::mir::Local;

use super::*;
use crate::{points_to, ty_shape::TyShape};
use crate::{points_to, tag_analysis, ty_shape::TyShape};

#[derive(Debug, Clone)]
pub enum AbsMem {
Expand Down Expand Up @@ -766,26 +766,26 @@ impl Graph {
}
}

pub fn objs_at(&self, l: Local, proj: &[crate::analysis::AccElem]) -> Vec<&Obj> {
pub fn objs_at(&self, l: Local, proj: &[tag_analysis::AccElem]) -> Vec<&Obj> {
let id = some_or!(self.locals.get(&l), return vec![]);
self.obj_at_rec(&self.nodes[*id].obj, proj)
}

fn obj_at_rec<'a>(&'a self, obj: &'a Obj, proj: &[crate::analysis::AccElem]) -> Vec<&'a Obj> {
fn obj_at_rec<'a>(&'a self, obj: &'a Obj, proj: &[tag_analysis::AccElem]) -> Vec<&'a Obj> {
if let Some(elem) = proj.get(0) {
match elem {
crate::analysis::AccElem::Field(f) => {
tag_analysis::AccElem::Field(f) => {
let Obj::Struct(fs, _) = obj else { return vec![] };
let obj = some_or!(fs.get(f), return vec![]);
self.obj_at_rec(obj, &proj[1..])
}
crate::analysis::AccElem::Index => {
tag_analysis::AccElem::Index => {
let Obj::Array(vs) = obj else { return vec![] };
vs.values()
.flat_map(|obj| self.obj_at_rec(obj, &proj[1..]))
.collect()
}
crate::analysis::AccElem::Deref => {
tag_analysis::AccElem::Deref => {
let Obj::Ptr(loc) = obj else { return vec![] };
let obj = some_or!(self.obj_at_location(loc), return vec![]);
self.obj_at_rec(obj, &proj[1..])
Expand Down
File renamed without changes.

0 comments on commit 692a8d9

Please sign in to comment.