// map back through an identity transformation (basically just recurse
        // on the callee traces)
        public static ErrorTraceBlock mapBackTraceIdentity(ErrorTraceBlock tblock, ModifyTrans tinfo)
        {
            var ret = new ErrorTraceBlock(tblock.blockName);

            ret.info = tblock.info;

            for (int i = 0; i < tblock.Cmds.Count; i++)
            {
                var tp = new InstrType();
                if (tblock.Cmds[i] is CallInstr)
                {
                    var ci = tblock.Cmds[i] as CallInstr;
                    if (ci.asyncCall)
                    {
                        tp = new InstrType(InstrTypeEnum.ASYNC, ci.callee);
                    }
                    else
                    {
                        tp = new InstrType(InstrTypeEnum.CALL, ci.callee);
                    }
                }

                var it = new InstrTrans(tp);
                ret.addInstr(it.mapBackTrace(tblock.Cmds, i, tinfo));
            }

            return(ret);
        }
 // set to the identity transformation
 public void setIdentity(List <Cmd> cmds)
 {
     trans.Clear();
     foreach (Cmd c in cmds)
     {
         InstrTrans it = new InstrTrans(c, c);
         trans.Add(it);
     }
 }
        public void add(string procName, string blockName, InstrTrans itrans)
        {
            var key = new Duple <string, string>(procName, blockName);

            if (!dict.ContainsKey(key))
            {
                dict.Add(key, new BlockTrans());
            }
            dict[key].addInstrTrans(itrans);
        }
 public void addInstrTrans(InstrTrans n)
 {
     trans.Add(n);
 }