Exemplo n.º 1
0
        protected override Subset <IVariable> Join(Subset <IVariable> left, Subset <IVariable> right)
        {
            var result = left.Clone();

            result.Union(right);
            return(result);
        }
        protected override Subset <DefinitionInstruction> Join(Subset <DefinitionInstruction> left, Subset <DefinitionInstruction> right)
        {
            var result = left.Clone();

            result.Union(right);
            return(result);
        }
        protected override Subset <DefinitionInstruction> Flow(CFGNode node, Subset <DefinitionInstruction> input)
        {
            var output = input.Clone();
            var kill   = KILL[node.Id];
            var gen    = GEN[node.Id];

            output.Except(kill);
            output.Union(gen);
            return(output);
        }
Exemplo n.º 4
0
        protected override Subset <IVariable> Flow(CFGNode node, Subset <IVariable> input)
        {
            var output = input.Clone();
            var kill   = KILL[node.Id];
            var gen    = GEN[node.Id];

            var successors = node.Successors.ToArray();

            for (var i = 0; i < successors.Length; ++i)
            {
                var successor        = successors[i];
                var derivedVariables = GetDerivedVariables(successor, i);

                output.Except(derivedVariables);
            }

            output.Except(kill);
            output.Union(gen);
            return(output);
        }