public virtual Expression VisitSlice(Slice slice) { slice.Expression = slice.Expression.Accept(this); if (sliceConst.Match(slice)) { Changed = true; return(sliceConst.Transform()); } if (sliceMem.Match(slice)) { Changed = true; return(sliceMem.Transform()); } // (slice (shl e n) n) ==> e if (sliceShift.Match(slice)) { Changed = true; return(sliceShift.Transform()); } return(slice); }
public virtual Expression VisitSlice(Slice slice) { var e = slice.Expression.Accept(this); slice = new Slice(slice.DataType, e, slice.Offset); if (sliceConst.Match(slice)) { Changed = true; return(sliceConst.Transform()); } if (sliceMem.Match(slice)) { Changed = true; return(sliceMem.Transform()); } // (slice (shl e n) n) ==> e if (sliceShift.Match(slice)) { Changed = true; return(sliceShift.Transform()); } return(slice); }