dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_oper.tc,1.41,1.42


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_oper.tc,1.41,1.42
Date: Thu, 29 May 2003 23:59:43 -0400

Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv4967/cscc/csharp

Modified Files:
        cs_oper.tc 
Log Message:


EqualitySem: pointer comparisons against null.


Index: cs_oper.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_oper.tc,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** cs_oper.tc  8 May 2003 19:05:07 -0000       1.41
--- cs_oper.tc  30 May 2003 03:59:41 -0000      1.42
***************
*** 1768,1771 ****
--- 1768,1808 ----
        }
  
+       /* If one of the arguments is a pointer and the other is null,
+          then the code generator knows how to handle the operation */
+       if(ILType_IsPointer(CSSemGetType(value1)))
+       {
+               if(CSSemGetType(value2) == ILType_Null)
+               {
+                       if(table == ILOp_Eq)
+                       {
+                               *parent = ILNode_IsNull_create(node->expr1);
+                       }
+                       else
+                       {
+                               *parent = ILNode_IsNonNull_create(node->expr1);
+                       }
+                       yysetfilename(*parent, yygetfilename(node));
+                       yysetlinenum(*parent, yygetlinenum(node));
+                       CSSemSetRValue(value1, ILType_Boolean);
+                       return value1;
+               }
+       }
+       else if(CSSemGetType(value1) == ILType_Null &&
+                       ILType_IsPointer(CSSemGetType(value2)))
+       {
+               if(table == ILOp_Eq)
+               {
+                       *parent = ILNode_IsNull_create(node->expr2);
+               }
+               else
+               {
+                       *parent = ILNode_IsNonNull_create(node->expr2);
+               }
+               yysetfilename(*parent, yygetfilename(node));
+               yysetlinenum(*parent, yygetlinenum(node));
+               CSSemSetRValue(value1, ILType_Boolean);
+               return value1;
+       }
+ 
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, name, &(value1), node->expr1,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]