tweak reg resolution repr
This commit is contained in:
parent
03be7a6350
commit
c05e8ba34f
2 changed files with 17 additions and 4 deletions
|
|
@ -232,13 +232,26 @@ impl<'a> MethodCFG<'a> {
|
||||||
dot_string
|
dot_string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Compute a sanitized version of the method name
|
||||||
|
pub(crate) fn dot_sanitized_method_dscr(&self) -> String {
|
||||||
|
self.method
|
||||||
|
.descriptor
|
||||||
|
.__str__()
|
||||||
|
.replace("/", "_")
|
||||||
|
.replace(";", "")
|
||||||
|
.replace(">", "")
|
||||||
|
.replace("-", "_")
|
||||||
|
.replace("(", "_")
|
||||||
|
.replace(")", "_")
|
||||||
|
}
|
||||||
|
|
||||||
// method call: cluster_{mth}:node_{i}:i{j}:e -> cluster_{mth2}:n ?
|
// method call: cluster_{mth}:node_{i}:i{j}:e -> cluster_{mth2}:n ?
|
||||||
|
|
||||||
/// Serialize the graph to dot format.
|
/// Serialize the graph to dot format.
|
||||||
pub fn to_dot_subgraph(&self) -> String {
|
pub fn to_dot_subgraph(&self) -> String {
|
||||||
let mut dot_string = format!(
|
let mut dot_string = format!(
|
||||||
"subgraph \"cluster_{}\" {{\n",
|
"subgraph \"cluster_{}\" {{\n",
|
||||||
self.method.descriptor.__str__()
|
self.dot_sanitized_method_dscr()
|
||||||
);
|
);
|
||||||
dot_string += " style=\"dashed\";\n";
|
dot_string += " style=\"dashed\";\n";
|
||||||
dot_string += " color=\"black\";\n";
|
dot_string += " color=\"black\";\n";
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ impl MethodCFG<'_> {
|
||||||
let types = self.get_reg_types();
|
let types = self.get_reg_types();
|
||||||
let mut dot_string = format!(
|
let mut dot_string = format!(
|
||||||
"subgraph \"cluster_reg_types_{}\" {{\n",
|
"subgraph \"cluster_reg_types_{}\" {{\n",
|
||||||
self.method.descriptor.__str__()
|
self.dot_sanitized_method_dscr()
|
||||||
);
|
);
|
||||||
dot_string += " style=\"dashed\";\n";
|
dot_string += " style=\"dashed\";\n";
|
||||||
dot_string += " color=\"black\";\n";
|
dot_string += " color=\"black\";\n";
|
||||||
|
|
@ -129,9 +129,9 @@ impl MethodCFG<'_> {
|
||||||
dot_string += &format!(
|
dot_string += &format!(
|
||||||
" cluster_{}:node_{}:s -> cluster_reg_types_{}:node_{}:n \
|
" cluster_{}:node_{}:s -> cluster_reg_types_{}:node_{}:n \
|
||||||
[style=\"solid,bold\",color=grey,weight=10,constraint=true];\n",
|
[style=\"solid,bold\",color=grey,weight=10,constraint=true];\n",
|
||||||
self.method.descriptor.__str__(),
|
self.dot_sanitized_method_dscr(),
|
||||||
i,
|
i,
|
||||||
self.method.descriptor.__str__(),
|
self.dot_sanitized_method_dscr(),
|
||||||
name
|
name
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue