summaryrefslogtreecommitdiff
path: root/Source/Core/Absy.cs
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2010-09-03 15:50:30 +0000
committerGravatar qadeer <unknown>2010-09-03 15:50:30 +0000
commitfa7f754906cd45425c6d4d695e5978f21d333e86 (patch)
tree949f74ae40bb51ce5d5bfe3c77839031973cc274 /Source/Core/Absy.cs
parentc3a0562a1e4b713690b6d78d59316f9df41bc99f (diff)
more fixes to ExtractLoops
Diffstat (limited to 'Source/Core/Absy.cs')
-rw-r--r--Source/Core/Absy.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs
index 338f08a6..1d4380bf 100644
--- a/Source/Core/Absy.cs
+++ b/Source/Core/Absy.cs
@@ -380,6 +380,11 @@ namespace Microsoft.Boogie {
// create a new entry block and a new return block
// add edges from entry block to the loop header and the return block
// add calls o := p_h(i) at the end of the blocks that are sources of back edges
+ foreach (Block block in impl.Blocks)
+ {
+ AddToFullMap(fullMap, impl.Name, block.Label, block);
+ }
+
Dictionary<Block/*!*/, VariableSeq/*!*/>/*!*/ loopHeaderToInputs = new Dictionary<Block/*!*/, VariableSeq/*!*/>();
Dictionary<Block/*!*/, VariableSeq/*!*/>/*!*/ loopHeaderToOutputs = new Dictionary<Block/*!*/, VariableSeq/*!*/>();
Dictionary<Block/*!*/, Hashtable/*!*/>/*!*/ loopHeaderToSubstMap = new Dictionary<Block/*!*/, Hashtable/*!*/>();
@@ -461,7 +466,6 @@ namespace Microsoft.Boogie {
Contract.Assert(header != null);
LoopProcedure loopProc = loopHeaderToLoopProc[header];
Dictionary<Block, Block> blockMap = new Dictionary<Block, Block>();
- Set<Block> dummyBlocks = new Set<Block>();
CodeCopier codeCopier = new CodeCopier(loopHeaderToSubstMap[header]); // fix me
VariableSeq inputs = loopHeaderToInputs[header];
@@ -495,8 +499,6 @@ namespace Microsoft.Boogie {
Block/*!*/ block2 = new Block(Token.NoToken, block1.Label,
new CmdSeq(callCmd), new ReturnCmd(Token.NoToken));
impl.Blocks.Add(block1);
- dummyBlocks.Add(block1);
- dummyBlocks.Add(block2);
GotoCmd gotoCmd = source.TransferCmd as GotoCmd;
Contract.Assert(gotoCmd != null && gotoCmd.labelNames != null && gotoCmd.labelTargets != null && gotoCmd.labelTargets.Length >= 1);
@@ -576,12 +578,11 @@ namespace Microsoft.Boogie {
header.TransferCmd = new GotoCmd(Token.NoToken, new StringSeq(lastIterBlockName), new BlockSeq(lastIterBlock));
impl.Blocks.Add(lastIterBlock);
blockMap[lastIterBlock] = blockMap[header];
- dummyBlocks.Add(header);
-
+ blockMap.Remove(header);
+ fullMap[impl.Name].Remove(header.Label);
+ fullMap[impl.Name][lastIterBlockName] = lastIterBlock;
foreach (Block block in blockMap.Keys)
{
- if (dummyBlocks.Contains(block)) continue;
- AddToFullMap(fullMap, impl.Name, block.Label, block);
AddToFullMap(fullMap, loopProc.Name, blockMap[block].Label, block);
}
}