public override ICodeNode VisitBoxExpression(BoxExpression node)
 {
     node = (BoxExpression)this.VisitBoxExpression(node);
     V_0  = node.get_BoxedAs().Resolve();
     if (V_0 != null && V_0.get_IsEnum() && !node.get_BoxedAs().get_IsArray() && node.get_BoxedExpression() as LiteralExpression != null)
     {
         node.set_BoxedExpression(EnumHelper.GetEnumExpression(V_0, node.get_BoxedExpression() as LiteralExpression, this.typeSystem));
     }
     return(node);
 }
 public override ICodeNode VisitBoxExpression(BoxExpression node)
 {
     dummyVar0 = this.VisitBoxExpression(node);
     if (node.get_BoxedExpression().get_CodeNodeType() == 22 && String.op_Equality(node.get_BoxedAs().get_FullName(), this.currentTypeSystem.get_Boolean().get_FullName()))
     {
         this.FixBooleanLiteral(node.get_BoxedExpression() as LiteralExpression);
         return(node.get_BoxedExpression().CloneAndAttachInstructions(node.get_MappedInstructions()));
     }
     if (node.get_BoxedExpression().get_CodeNodeType() == 31 && ((ExplicitCastExpression)node.get_BoxedExpression()).get_Expression().get_CodeNodeType() == 31)
     {
         stackVariable20 = node.get_BoxedExpression() as ExplicitCastExpression;
         V_0             = stackVariable20.get_Expression() as ExplicitCastExpression;
         if (String.op_Equality(stackVariable20.get_TargetType().get_FullName(), this.currentTypeSystem.get_Char().get_FullName()) && String.op_Equality(V_0.get_TargetType().get_FullName(), this.currentTypeSystem.get_UInt16().get_FullName()))
         {
             V_0.set_TargetType(this.currentTypeSystem.get_Char());
             node.set_BoxedExpression(V_0);
         }
     }
     return(node);
 }
Exemple #3
0
 public virtual void VisitBoxExpression(BoxExpression node)
 {
     this.Visit(node.get_BoxedExpression());
     return;
 }
 public virtual ICodeNode VisitBoxExpression(BoxExpression node)
 {
     node.set_BoxedExpression((Expression)this.Visit(node.get_BoxedExpression()));
     return(node);
 }
 public override void VisitBoxExpression(BoxExpression node)
 {
     V_0 = new Stack <Expression>();
     V_0.Push(this.parentExpressions.Pop());
     if (this.parentExpressions.get_Count() > 0)
     {
         V_1 = this.parentExpressions.Peek();
         if (V_1 as MemberReferenceExpresion == null)
         {
             if (V_1 as MethodInvocationExpression != null || V_1 as FieldReferenceExpression != null || V_1 as PropertyReferenceExpression != null)
             {
                 node.set_IsAutoBox(true);
             }
             else
             {
                 if (V_1 as BinaryExpression == null)
                 {
                     if (V_1 as ReturnExpression == null)
                     {
                         if (V_1 as YieldReturnExpression != null && (V_1 as YieldReturnExpression).get_Expression().Equals(node))
                         {
                             node.set_IsAutoBox(true);
                         }
                     }
                     else
                     {
                         if (!String.op_Equality(this.context.get_Method().get_ReturnType().get_FullName(), "System.Object"))
                         {
                             V_4 = node.get_BoxedExpression().get_ExpressionType().Resolve();
                             if (V_4 != null && V_4.get_IsValueType())
                             {
                                 node.set_IsAutoBox(true);
                             }
                         }
                         else
                         {
                             node.set_IsAutoBox(true);
                         }
                     }
                 }
                 else
                 {
                     V_3 = V_1 as BinaryExpression;
                     if (V_3.get_IsAssignmentExpression() && V_3.get_Right().Equals(node))
                     {
                         node.set_IsAutoBox(true);
                     }
                     if (V_3.get_IsComparisonExpression() && node.get_BoxedAs().get_IsGenericParameter())
                     {
                         if (V_3.get_Left() == node && V_3.get_Right() as LiteralExpression != null && (V_3.get_Right() as LiteralExpression).get_Value() == null)
                         {
                             node.set_IsAutoBox(true);
                         }
                         if (V_3.get_Right() == node && V_3.get_Left() as LiteralExpression != null && (V_3.get_Left() as LiteralExpression).get_Value() == null)
                         {
                             node.set_IsAutoBox(true);
                         }
                     }
                 }
             }
         }
         else
         {
             V_2 = this.parentExpressions.Pop() as MemberReferenceExpresion;
             V_0.Push(V_2);
             if (V_2.get_Member() as MethodReference != null)
             {
                 node.set_IsAutoBox(true);
             }
         }
     }
     while (V_0.get_Count() > 0)
     {
         this.parentExpressions.Push(V_0.Pop());
     }
     this.VisitBoxExpression(node);
     return;
 }