[Fb-contrib-commit] SF.net SVN: fb-contrib: [702] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-12-03 10:42:29
|
Revision: 702 http://svn.sourceforge.net/fb-contrib/?rev=702&view=rev Author: dbrosius Date: 2006-12-03 02:42:28 -0800 (Sun, 03 Dec 2006) Log Message: ----------- if a block starts and ends after another block, THAT is when it is part of a compound condition, in which case combine the two blocks, and push the load and stores up to the parent Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-03 10:21:49 UTC (rev 701) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-03 10:42:28 UTC (rev 702) @@ -129,7 +129,7 @@ } else if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == GOTO_W)) { int target = getBranchTarget(); if (target > getPC()) { - ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, target); + ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, getPC(), target); if (sb != null) { sb.pushUpLoadStores(); } else { @@ -174,14 +174,14 @@ * * @return the scope block found or null */ - private ScopeBlock findScopeBlockWithTarget(ScopeBlock sb, int target) { - if (sb.finishLocation == target) + private ScopeBlock findScopeBlockWithTarget(ScopeBlock sb, int start, int target) { + if ((sb.startLocation < start) && (sb.finishLocation <= target)) return sb; if (sb.children != null) { for (ScopeBlock child : sb.children) { - ScopeBlock targetBlock = findScopeBlockWithTarget(child, target); + ScopeBlock targetBlock = findScopeBlockWithTarget(child, start, target); if (targetBlock != null) return targetBlock; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |