[Scummvm-cvs-logs] SF.net SVN: scummvm: [28678] tools/branches/gsoc2007-decompiler/finalD/ PseudoCode.py

brixxie at users.sourceforge.net brixxie at users.sourceforge.net
Mon Aug 20 16:39:57 CEST 2007


Revision: 28678
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28678&view=rev
Author:   brixxie
Date:     2007-08-20 07:39:57 -0700 (Mon, 20 Aug 2007)

Log Message:
-----------
also output latching node's pre-jump instructions

Modified Paths:
--------------
    tools/branches/gsoc2007-decompiler/finalD/PseudoCode.py

Modified: tools/branches/gsoc2007-decompiler/finalD/PseudoCode.py
===================================================================
--- tools/branches/gsoc2007-decompiler/finalD/PseudoCode.py	2007-08-20 14:15:20 UTC (rev 28677)
+++ tools/branches/gsoc2007-decompiler/finalD/PseudoCode.py	2007-08-20 14:39:57 UTC (rev 28678)
@@ -98,9 +98,22 @@
             else:
                 succs_asc = self.cfg.out_nbrs(bb.if_follow)
                 succs_asc.sort(key=node_to_revpo(self.cfg))
-                for s in succs_asc:
-                    if s != bb.loop_follow:
-                        self._write_code(s, i+1, bb.loop_latch, ifollow)
+                if bb.loop_latch == bb.if_follow:
+                    if bb.loop_latch not in self.traversed:
+                        self._write_bb(bb.if_follow, i+1)
+                    else:
+                        self._emit_goto(bb.if_follow, i+1)
+                else:
+                    for s in [bb.if_follow, succs_asc]:
+                        if s != bb.loop_follow:
+                            if s not in self.traversed:
+                                self._write_code(s,
+                                                 i+1,
+                                                 bb.loop_latch,
+                                                 ifollow)
+                            else:
+                                self._emit_goto(s, i+1)
+                            
         # write loop trailer
         if bb.loop_type == LT.pre_tested:
             self._write_bb(bbn, i+1)


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