public virtual Instruction TransformPhiAssignment(PhiAssignment phi)
        {
            var args = phi.Src.Arguments;

            for (int i = 0; i < args.Length; ++i)
            {
                var value = args[i].Value.Accept(this);
                args[i] = new PhiArgument(args[i].Block, value);
            }
            phi.Dst = (Identifier)phi.Dst.Accept(this);
            return(phi);
        }
Example #2
0
        public override Instruction TransformPhiAssignment(PhiAssignment phi)
        {
            var args = phi.Src.Arguments;

            for (int i = 0; i < args.Length; ++i)
            {
                var value = args[i].Value.Accept(this);
                args[i] = new PhiArgument(args[i].Block, value);
            }
            if (replaceDefinitions)
            {
                phi.Dst = (Identifier)phi.Dst.Accept(this);
            }
            return(phi);
        }
Example #3
0
        public Expression VisitPhiFunction(PhiFunction phi)
        {
            var args = new PhiArgument[phi.Arguments.Length];

            for (int i = 0; i < args.Length; ++i)
            {
                var exp = phi.Arguments[i].Value.Accept(this);
                if (exp is InvalidConstant)
                {
                    return(exp);
                }
                args[i] = new PhiArgument(phi.Arguments[i].Block, exp);
            }
            return(new PhiFunction(phi.DataType, args));
        }