Ejemplo n.º 1
0
 private Expression ParseMakeTypedReference(IOperation currentOperation) {
   Contract.Requires(currentOperation != null);
   MakeTypedReference result = new MakeTypedReference();
   Expression operand = this.PopOperandStack();
   Contract.Assume(currentOperation.Value is ITypeReference);
   var type = (ITypeReference)currentOperation.Value;
   operand.Type = Immutable.ManagedPointerType.GetManagedPointerType(type, this.host.InternFactory); ;
   result.Operand = operand;
   return result;
 }
Ejemplo n.º 2
0
 private Expression ParseMakeTypedReference(IOperation currentOperation)
 {
     MakeTypedReference result = new MakeTypedReference();
       Expression operand = this.PopOperandStack();
       var type = (ITypeReference)currentOperation.Value;
       if (type.IsValueType)
     type = Immutable.ManagedPointerType.GetManagedPointerType(type, this.host.InternFactory);
       operand.Type = type;
       result.Operand = operand;
       return result;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visits the specified make typed reference.
 /// </summary>
 /// <param name="makeTypedReference">The make typed reference.</param>
 /// <returns></returns>
 protected virtual IExpression DeepCopy(MakeTypedReference makeTypedReference)
 {
     makeTypedReference.Operand = Substitute(makeTypedReference.Operand);
       makeTypedReference.Type = this.Substitute(makeTypedReference.Type);
       return makeTypedReference;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Visits the specified make typed reference.
 /// </summary>
 /// <param name="makeTypedReference">The make typed reference.</param>
 public override void Visit(IMakeTypedReference makeTypedReference)
 {
     MakeTypedReference mutableMakeTypedReference = new MakeTypedReference(makeTypedReference);
     this.resultExpression = this.myCodeCopier.DeepCopy(mutableMakeTypedReference);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Visits the specified make typed reference.
 /// </summary>
 /// <param name="makeTypedReference">The make typed reference.</param>
 /// <returns></returns>
 public virtual IExpression Visit(MakeTypedReference makeTypedReference)
 {
     makeTypedReference.Operand = Visit(makeTypedReference.Operand);
       makeTypedReference.Type = this.Visit(makeTypedReference.Type);
       return makeTypedReference;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Rewrites the children of the given make typed reference expression.
 /// </summary>
 public virtual void RewriteChildren(MakeTypedReference makeTypedReference)
 {
     this.RewriteChildren((Expression)makeTypedReference);
       makeTypedReference.Operand = this.Rewrite(makeTypedReference.Operand);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Visits the specified make typed reference.
 /// </summary>
 /// <param name="makeTypedReference">The make typed reference.</param>
 public override void Visit(IMakeTypedReference makeTypedReference)
 {
     MakeTypedReference mutableMakeTypedReference = makeTypedReference as MakeTypedReference;
     if (alwaysMakeACopy || mutableMakeTypedReference == null) mutableMakeTypedReference = new MakeTypedReference(makeTypedReference);
     this.resultExpression = this.myCodeMutator.Visit(mutableMakeTypedReference);
 }