示例#1
0
 internal void RemoveReads(IEnumerable <Block> blocks, IEnumerable <Variable> arrays)
 {
     foreach (var b in blocks)
     {
         List <Cmd> newCmds = new List <Cmd>();
         foreach (var c in b.Cmds)
         {
             CallCmd callCmd = c as CallCmd;
             if (callCmd != null)
             {
                 Variable v;
                 verifier.TryGetArrayFromLogProcedure(callCmd.callee, AccessType.READ, out v);
                 if (v == null)
                 {
                     verifier.TryGetArrayFromCheckProcedure(callCmd.callee, AccessType.READ, out v);
                 }
                 if (v != null && arrays.Contains(v))
                 {
                     continue;
                 }
             }
             newCmds.Add(c);
         }
         b.Cmds = newCmds;
     }
 }