|
@@ -179,7 +179,7 @@ namespace MainNs
|
|
|
var source = EditorForm.CreateBlobForText(this.Library, section.Text);
|
|
|
source = this.Library.GetBlobAstUf8(source);
|
|
|
|
|
|
- string[] options = new string [1];
|
|
|
+ string[] options = new string[1];
|
|
|
options[0] = "-view-cfg-only";
|
|
|
EditorForm.OptimizeResult opt = EditorForm.RunOptimize(this.Library, options, source);
|
|
|
if (!opt.Succeeded)
|
|
@@ -187,9 +187,18 @@ namespace MainNs
|
|
|
MessageBox.Show("Failed to optimize: " + opt.ResultText);
|
|
|
return;
|
|
|
}
|
|
|
+ const string dotStart = "digraph";
|
|
|
+ string dotText = opt.ResultText.Substring(opt.ResultText.IndexOf(dotStart));
|
|
|
+ while (dotText.LastIndexOf(dotStart) != -1)
|
|
|
+ {
|
|
|
+ string dot = dotText.Substring(dotText.LastIndexOf(dotStart));
|
|
|
+ dot = dot.Substring(0, dot.LastIndexOf("}") + 1);
|
|
|
+ dot = dot.Replace("\u0001??", "");
|
|
|
+ dot = dot.Replace("\u0001?", "");
|
|
|
+ EditorForm.LogContextMenuHelper.ShowDot(dot);
|
|
|
+ dotText = dotText.Substring(0, dotText.LastIndexOf(dotStart));
|
|
|
+ }
|
|
|
|
|
|
- string dotText = opt.ResultText.Substring(opt.ResultText.IndexOf("digraph"));
|
|
|
- EditorForm.LogContextMenuHelper.ShowDot(dotText);
|
|
|
}
|
|
|
}
|
|
|
|