private static Expression ParseSizeOf(IOperation currentOperation) { Contract.Requires(currentOperation != null); SizeOf result = new SizeOf(); result.TypeToSize = (ITypeReference)currentOperation.Value; return result; }
private static Expression ParseSizeOf(IOperation currentOperation) { SizeOf result = new SizeOf(); result.TypeToSize = (ITypeReference)currentOperation.Value; return result; }
/// <summary> /// Visits the specified size of. /// </summary> /// <param name="sizeOf">The size of.</param> public override void Visit(ISizeOf sizeOf) { SizeOf mutableSizeOf = new SizeOf(sizeOf); this.resultExpression = this.myCodeCopier.DeepCopy(mutableSizeOf); }
/// <summary> /// Visits the specified size of. /// </summary> /// <param name="sizeOf">The size of.</param> /// <returns></returns> protected virtual IExpression DeepCopy(SizeOf sizeOf) { sizeOf.TypeToSize = this.Substitute(sizeOf.TypeToSize); sizeOf.Type = this.Substitute(sizeOf.Type); return sizeOf; }
/// <summary> /// Rewrites the children of the given sizeof() expression. /// </summary> public virtual void RewriteChildren(SizeOf sizeOf) { this.RewriteChildren((Expression)sizeOf); sizeOf.TypeToSize = this.Rewrite(sizeOf.TypeToSize); }
/// <summary> /// Visits the specified size of. /// </summary> /// <param name="sizeOf">The size of.</param> public override void Visit(ISizeOf sizeOf) { SizeOf mutableSizeOf = sizeOf as SizeOf; if (alwaysMakeACopy || mutableSizeOf == null) mutableSizeOf = new SizeOf(sizeOf); this.resultExpression = this.myCodeMutator.Visit(mutableSizeOf); }
/// <summary> /// Visits the specified size of. /// </summary> /// <param name="sizeOf">The size of.</param> /// <returns></returns> public virtual IExpression Visit(SizeOf sizeOf) { sizeOf.TypeToSize = Visit(sizeOf.TypeToSize); sizeOf.Type = this.Visit(sizeOf.Type); return sizeOf; }