summaryrefslogtreecommitdiff
path: root/Source/Core/DeadVarElim.cs
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2010-12-16 05:24:04 +0000
committerGravatar qadeer <unknown>2010-12-16 05:24:04 +0000
commitabd9988c758efb08b17f521b9f2826a0011df1f1 (patch)
tree3d9f3b633f8e080557bcc7b768ae8b35a29701ee /Source/Core/DeadVarElim.cs
parent64d649e4b500ab73a18ac46d949beeae65b2cee0 (diff)
fixed a couple of issues:
1. eliminated special case for alloc 2. added iteration over out parameters in VisitCallCmd
Diffstat (limited to 'Source/Core/DeadVarElim.cs')
-rw-r--r--Source/Core/DeadVarElim.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/DeadVarElim.cs b/Source/Core/DeadVarElim.cs
index 711770c2..ff097ce8 100644
--- a/Source/Core/DeadVarElim.cs
+++ b/Source/Core/DeadVarElim.cs
@@ -163,11 +163,17 @@ namespace Microsoft.Boogie {
Contract.Ensures(Contract.Result<Cmd>() != null);
Cmd ret = base.VisitCallCmd(callCmd);
Procedure callee = callCmd.Proc;
- if (callee != null && modSets.ContainsKey(callee)) {
+ if (callee == null)
+ return ret;
+ if (modSets.ContainsKey(callee)) {
foreach (Variable var in modSets[callee]) {
ProcessVariable(var);
}
}
+ foreach (IdentifierExpr ie in callCmd.Outs)
+ {
+ ProcessVariable(ie.Decl);
+ }
return ret;
}
private static void ProcessVariable(Variable var) {
@@ -176,8 +182,6 @@ namespace Microsoft.Boogie {
return;
if (!(var is GlobalVariable))
return;
- if (var.Name == "alloc")
- return;
if (!modSets.ContainsKey(localProc)) {
modSets[localProc] = new HashSet<Variable/*!*/>();
}