예제 #1
0
        public bool ApplyTransform(Context context, BaseTransformation transformation, List <Operand> virtualRegisters = null)
        {
            if (!transformation.Match(context, this))
            {
                return(false);
            }

            TraceBefore(context, transformation);

            if (virtualRegisters != null)
            {
                CollectVirtualRegisters(context, virtualRegisters);
            }

            // TODO: note last virtual register #
            // TODO: note the node

            transformation.Transform(context, this);

            // TODO: add all NEW virtual register to the collection

            TraceAfter(context);

            return(true);
        }
예제 #2
0
        public bool ApplyTransform(Context context, BaseTransformation transformation, List <Operand> virtualRegisters = null)
        {
            if (!transformation.Match(context, this))
            {
                return(false);
            }

            TraceBefore(context, transformation);

            if (virtualRegisters != null)
            {
                CollectVirtualRegisters(context, virtualRegisters);
            }

            transformation.Transform(context, this);

            TraceAfter(context);

            return(true);
        }