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
|
||||
}
|
||||
|
||||
/// 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 ?
|
||||
|
||||
/// Serialize the graph to dot format.
|
||||
pub fn to_dot_subgraph(&self) -> String {
|
||||
let mut dot_string = format!(
|
||||
"subgraph \"cluster_{}\" {{\n",
|
||||
self.method.descriptor.__str__()
|
||||
self.dot_sanitized_method_dscr()
|
||||
);
|
||||
dot_string += " style=\"dashed\";\n";
|
||||
dot_string += " color=\"black\";\n";
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ impl MethodCFG<'_> {
|
|||
let types = self.get_reg_types();
|
||||
let mut dot_string = format!(
|
||||
"subgraph \"cluster_reg_types_{}\" {{\n",
|
||||
self.method.descriptor.__str__()
|
||||
self.dot_sanitized_method_dscr()
|
||||
);
|
||||
dot_string += " style=\"dashed\";\n";
|
||||
dot_string += " color=\"black\";\n";
|
||||
|
|
@ -129,9 +129,9 @@ impl MethodCFG<'_> {
|
|||
dot_string += &format!(
|
||||
" cluster_{}:node_{}:s -> cluster_reg_types_{}:node_{}:n \
|
||||
[style=\"solid,bold\",color=grey,weight=10,constraint=true];\n",
|
||||
self.method.descriptor.__str__(),
|
||||
self.dot_sanitized_method_dscr(),
|
||||
i,
|
||||
self.method.descriptor.__str__(),
|
||||
self.dot_sanitized_method_dscr(),
|
||||
name
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue