[Scummvm-cvs-logs] SF.net SVN: scummvm:[42508] tools/branches/gsoc2009-decompiler/decompiler/ graph.cpp
kjdf at users.sourceforge.net
kjdf at users.sourceforge.net
Wed Jul 15 17:53:52 CEST 2009
Revision: 42508
http://scummvm.svn.sourceforge.net/scummvm/?rev=42508&view=rev
Author: kjdf
Date: 2009-07-15 15:53:52 +0000 (Wed, 15 Jul 2009)
Log Message:
-----------
decompiler: fixed too greedy block collection for if statements
Modified Paths:
--------------
tools/branches/gsoc2009-decompiler/decompiler/graph.cpp
Modified: tools/branches/gsoc2009-decompiler/decompiler/graph.cpp
===================================================================
--- tools/branches/gsoc2009-decompiler/decompiler/graph.cpp 2009-07-15 15:51:47 UTC (rev 42507)
+++ tools/branches/gsoc2009-decompiler/decompiler/graph.cpp 2009-07-15 15:53:52 UTC (rev 42508)
@@ -65,8 +65,9 @@
if (fontsize != 0)
ret << "fontsize=" << fontsize << ",";
ret << "shape=box,label=\"<number=" << u->_postOrder;
- if (u->_dominator)
- ret << ", dom=" << u->_dominator->_postOrder;
+ // TODO: instead, fix the dominator (and post-ordering) algorithm to deal with multi-entry graphs
+ // if (u->_dominator)
+ // ret << ", dom=" << u->_dominator->_postOrder;
ret << ">\\n" << graphvizEscapeLabel(u->toString()) << "\"];" << endl;
return ret.str();
}
@@ -432,7 +433,9 @@
void ControlFlowGraph::structureConditionals() {
assignDominators();
- foreach (Node *u, inPostOrder(_nodes))
+ list<Node*> nodes = inPostOrder(_nodes);
+ nodes.reverse();
+ foreach (Node *u, nodes)
if (u->_out.size() == 2) {
_nodes.push_back(new IfThenElse(this, u));
cerr << "done if-then-else at " << phex(u->address()) << endl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list