Skip to main content

luaur_analysis/methods/
constraint_graph_dump.rs

1use crate::functions::dot_escape::dot_escape;
2use crate::functions::to_string_constraint_graph::to_string_constraint_vertex;
3use crate::records::constraint_graph::ConstraintGraph;
4use alloc::string::String;
5
6impl ConstraintGraph {
7    pub fn dump(&mut self) {
8        for (v, deps) in self.dependencies.iter() {
9            let vstr = unsafe { to_string_constraint_vertex(v.clone()) };
10            let deps_ref = unsafe { &**deps };
11            for d in deps_ref.order.iter() {
12                // The C++ `for (auto d : *deps)` iterates only present entries.
13                if !deps_ref.contains(d.clone()) {
14                    continue;
15                }
16
17                let mut line = String::new();
18                dot_escape(&mut line, &vstr);
19                line.push_str(" -> ");
20                let dstr = unsafe { to_string_constraint_vertex(d.clone()) };
21                dot_escape(&mut line, &dstr);
22                std::println!("{}", line);
23            }
24        }
25    }
26}