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); }
public static void Add(BaseTransformation transformation) { lock (Transformations) { Transformations.Add(transformation); } }
public void TraceBefore(Context context, BaseTransformation transformation) { if (transformation.Name != null) { TraceLog?.Log($"*** {transformation.Name}"); } if (transformation.Log) { SpecialTraceLog?.Log($"{transformation.Name}\t{MethodCompiler.Method.FullName} at {context}"); } TraceLog?.Log($"BEFORE:\t{context}"); }
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); }