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.35,1.36


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_oper.tc,1.35,1.36
Date: Wed, 26 Feb 2003 01:34:22 -0500

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

Modified Files:
        cs_oper.tc 
Log Message:


Pass the expression nodes to the operator resolution routines in
codegen so that implicit constant coercions (e.g. int -> uint)
can be performed.


Index: cs_oper.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_oper.tc,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** cs_oper.tc  21 Feb 2003 04:30:03 -0000      1.35
--- cs_oper.tc  26 Feb 2003 06:34:20 -0000      1.36
***************
*** 24,33 ****
   * Look for a user-specified binary operator of a particular name.
   */
! static ILMethod *FindUserBinaryOperator(ILGenInfo *info,
!                                                                               
const char *name,
!                                                                               
ILType *arg1Type,
!                                                                               
ILType *arg2Type)
  {
        ILMethod *method;
        ILClass *arg1Class = ILTypeToClass(info, arg1Type);
        ILClass *arg2Class = ILTypeToClass(info, arg2Type);
--- 24,34 ----
   * Look for a user-specified binary operator of a particular name.
   */
! static ILMethod *FindUserBinaryOperator(ILGenInfo *info, const char *name,
!                                                                               
CSSemValue *arg1, ILNode *arg1Node,
!                                                                               
CSSemValue *arg2, ILNode *arg2Node)
  {
        ILMethod *method;
+       ILType *arg1Type = CSSemGetType(*arg1);
+       ILType *arg2Type = CSSemGetType(*arg2);
        ILClass *arg1Class = ILTypeToClass(info, arg1Type);
        ILClass *arg2Class = ILTypeToClass(info, arg2Type);
***************
*** 37,41 ****
        {
                method = ILResolveBinaryOperator(info, arg1Class, name,
!                                                                               
 arg1Type, arg2Type);
                if(method)
                {
--- 38,43 ----
        {
                method = ILResolveBinaryOperator(info, arg1Class, name,
!                                                                               
 arg1Type, arg1Node,
!                                                                               
 arg2Type, arg2Node);
                if(method)
                {
***************
*** 48,52 ****
        {
                method = ILResolveBinaryOperator(info, arg2Class, name,
!                                                                               
 arg1Type, arg2Type);
                if(method)
                {
--- 50,55 ----
        {
                method = ILResolveBinaryOperator(info, arg2Class, name,
!                                                                               
 arg1Type, arg1Node,
!                                                                               
 arg2Type, arg2Node);
                if(method)
                {
***************
*** 210,215 ****
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, CSSemGetType(value1),
!                                                                       
CSSemGetType(value2));
        if(method)
        {
--- 213,218 ----
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, &(value1), node->expr1,
!                                                                       
&(value2), node->expr2);
        if(method)
        {
***************
*** 272,283 ****
   */
  static ILMethod *FindUserUnaryOperator(ILGenInfo *info, const char *name,
!                                                                          
ILType *argType)
  {
        ILMethod *method;
        ILClass *argClass = ILTypeToClass(info, argType);
  
        if(argClass)
        {
!               method = ILResolveUnaryOperator(info, argClass, name, argType);
                if(method)
                {
--- 275,287 ----
   */
  static ILMethod *FindUserUnaryOperator(ILGenInfo *info, const char *name,
!                                                                          
CSSemValue *arg, ILNode *argNode)
  {
        ILMethod *method;
+       ILType *argType = CSSemGetType(*arg);
        ILClass *argClass = ILTypeToClass(info, argType);
  
        if(argClass)
        {
!               method = ILResolveUnaryOperator(info, argClass, name, argType, 
argNode);
                if(method)
                {
***************
*** 330,334 ****
  
        /* Look for a user-specified operator */
!       method = FindUserUnaryOperator(info, name, CSSemGetType(value));
        if(method)
        {
--- 334,338 ----
  
        /* Look for a user-specified operator */
!       method = FindUserUnaryOperator(info, name, &(value), node->expr);
        if(method)
        {
***************
*** 415,420 ****
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, "op_Addition",
!                                                                       
CSSemGetType(value1),
!                                                                       
CSSemGetType(value2));
        if(method)
        {
--- 419,424 ----
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, "op_Addition",
!                                                                       
&(value1), node->expr1,
!                                                                       
&(value2), node->expr2);
        if(method)
        {
***************
*** 566,571 ****
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, "op_Subtraction",
!                                                                       
CSSemGetType(value1),
!                                                                       
CSSemGetType(value2));
        if(method)
        {
--- 570,575 ----
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, "op_Subtraction",
!                                                                       
&(value1), node->expr1,
!                                                                       
&(value2), node->expr2);
        if(method)
        {
***************
*** 964,969 ****
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, CSSemGetType(value1),
!                                                                       
CSSemGetType(value2));
  
        if(method)
--- 968,973 ----
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, &(value1), node->expr1,
!                                                                       
&(value2), node->expr2);
  
        if(method)
***************
*** 1205,1209 ****
  
        /* Look for an appropriate operator */
!       method = FindUserUnaryOperator(info, opName, CSSemGetType(value));
        if(!method)
        {
--- 1209,1213 ----
  
        /* Look for an appropriate operator */
!       method = FindUserUnaryOperator(info, opName, &(value), node->expr);
        if(!method)
        {
***************
*** 1463,1467 ****
        {
                method = FindUserUnaryOperator(info, "op_LogicalNot",
!                                                                          
CSSemGetType(value));
                if(method)
                {
--- 1467,1471 ----
        {
                method = FindUserUnaryOperator(info, "op_LogicalNot",
!                                                                          
&(value), node->expr);
                if(method)
                {
***************
*** 1510,1515 ****
        {
                method1 = FindUserBinaryOperator
!                                       (info, "op_BitwiseAnd", 
CSSemGetType(value1),
!                                        CSSemGetType(value1));
                method2 = ILResolveConversionOperator
                                        (info, 
ILType_ToClass(CSSemGetType(value1)), "op_True",
--- 1514,1519 ----
        {
                method1 = FindUserBinaryOperator
!                                       (info, "op_BitwiseAnd", &(value1), 
node->expr1,
!                                        &(value1), node->expr2);
                method2 = ILResolveConversionOperator
                                        (info, 
ILType_ToClass(CSSemGetType(value1)), "op_True",
***************
*** 1605,1610 ****
        {
                method1 = FindUserBinaryOperator
!                                       (info, "op_BitwiseOr", 
CSSemGetType(value1),
!                                        CSSemGetType(value1));
                method2 = ILResolveConversionOperator
                                        (info, 
ILType_ToClass(CSSemGetType(value1)), "op_True",
--- 1609,1614 ----
        {
                method1 = FindUserBinaryOperator
!                                       (info, "op_BitwiseOr", &(value1), 
node->expr1,
!                                        &(value1), node->expr2);
                method2 = ILResolveConversionOperator
                                        (info, 
ILType_ToClass(CSSemGetType(value1)), "op_True",
***************
*** 1751,1756 ****
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, CSSemGetType(value1),
!                                                                       
CSSemGetType(value2));
        if(method)
        {
--- 1755,1760 ----
  
        /* Look for a user-specified operator */
!       method = FindUserBinaryOperator(info, name, &(value1), node->expr1,
!                                                                       
&(value2), node->expr2);
        if(method)
        {





reply via email to

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