Ejemplo n.º 1
0
        private List <(HashSet <string> IN, HashSet <string> OUT)> Execute(List <Instruction> TAC)
        {
            var cfg = GenCFG(TAC);

            var liveAct = new LiveVariableAnalysis();

            liveAct.ExecuteInternal(cfg);

            var listAct = liveAct.dictInOut
                          .Select(x => x.Value)
                          .Select(y => (y.IN as HashSet <string>, y.OUT as HashSet <string>));

            return(listAct.ToList());
        }
Ejemplo n.º 2
0
        private List <(HashSet <string> IN, HashSet <string> OUT)> Execute(List <Instruction> TAC)
        {
            var blocks = BasicBlockLeader.DivideLeaderToLeader(TAC);
            var cfg    = new ControlFlowGraph(blocks);

            var liveAct = new LiveVariableAnalysis();

            liveAct.ExecuteInternal(cfg);

            var listAct = liveAct.dictInOut
                          .Select(x => x.Value)
                          .Select(y => (y.IN as HashSet <string>, y.OUT as HashSet <string>));

            return(listAct.ToList());
        }