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/c c_defs.tc,1.17,1.18 c_lvalue.tc,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/c c_defs.tc,1.17,1.18 c_lvalue.tc,1.10,1.11 c_oper.tc,1.22,1.23
Date: Tue, 05 Nov 2002 18:58:29 -0500

Update of /cvsroot/dotgnu-pnet/pnet/cscc/c
In directory subversions:/tmp/cvs-serv448/cscc/c

Modified Files:
        c_defs.tc c_lvalue.tc c_oper.tc 
Log Message:


Fix the use of "&" on arrays.


Index: c_defs.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/c/c_defs.tc,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** c_defs.tc   23 Aug 2002 04:20:34 -0000      1.17
--- c_defs.tc   5 Nov 2002 23:58:27 -0000       1.18
***************
*** 73,77 ****
  #define       C_SEMKIND_BOOLEAN               (1<<7)
  #define       C_SEMKIND_NO_REF                (1<<8)
! #define       C_SEMKIND_ERROR                 (1<<9)
  
  /*
--- 73,78 ----
  #define       C_SEMKIND_BOOLEAN               (1<<7)
  #define       C_SEMKIND_NO_REF                (1<<8)
! #define       C_SEMKIND_DECAYED               (1<<9)
! #define       C_SEMKIND_ERROR                 (1<<10)
  
  /*
***************
*** 104,107 ****
--- 105,109 ----
  #define       CSemIsBoolean(value)    (((value).kind__ & C_SEMKIND_BOOLEAN) 
!= 0)
  #define       CSemIsNoRef(value)              (((value).kind__ & 
C_SEMKIND_NO_REF) != 0)
+ #define       CSemIsDecayed(value)    (((value).kind__ & C_SEMKIND_DECAYED) 
!= 0)
  #define       CSemIsError(value)              (((value).kind__ & 
C_SEMKIND_ERROR) != 0)
  
***************
*** 109,113 ****
   * Get the type field from a semantic value.
   */
! #define       CSemGetType(value)              ((value).type__)
  
  /*
--- 111,120 ----
   * Get the type field from a semantic value.
   */
! #define       CSemGetType(value)                              ((value).type__)
! 
! /*
!  * Get the decayed type field from a semantic value.
!  */
! #define       CSemGetDecayedType(value)               ((ILType 
*)((value).extra__))
  
  /*
***************
*** 163,166 ****
--- 170,184 ----
                                (value).type__ = (type); \
                                (value).extra__ = 0; \
+                       } while (0)
+ 
+ /*
+  * Set a semantic value to an r-value reference that resulted
+  * from a decayed array l-value.
+  */
+ #define       CSemSetDecayedRValue(value,type,origType)       \
+                       do { \
+                               (value).kind__ = C_SEMKIND_RVALUE | 
C_SEMKIND_DECAYED; \
+                               (value).type__ = (type); \
+                               (value).extra__ = (void *)(origType); \
                        } while (0)
  

Index: c_lvalue.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/c/c_lvalue.tc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** c_lvalue.tc 14 Sep 2002 10:59:56 -0000      1.10
--- c_lvalue.tc 5 Nov 2002 23:58:27 -0000       1.11
***************
*** 120,124 ****
                                                  _("invalid use of non-lvalue 
array"));
                }
!               CSemSetRValue(value, CTypeDecay(info, fieldType));
        }
        else
--- 120,124 ----
                                                  _("invalid use of non-lvalue 
array"));
                }
!               CSemSetDecayedRValue(value, CTypeDecay(info, fieldType), 
fieldType);
        }
        else
***************
*** 388,392 ****
        else if(CTypeIsArray(fieldType))
        {
!               CSemSetRValue(value, CTypeDecay(info, fieldType));
        }
        else
--- 388,392 ----
        else if(CTypeIsArray(fieldType))
        {
!               CSemSetDecayedRValue(value, CTypeDecay(info, fieldType), 
fieldType);
        }
        else
***************
*** 588,592 ****
        {
                /* This is an array that decays to an r-value pointer */
!               CSemSetRValue(value, node->decayedType);
        }
        else
--- 588,592 ----
        {
                /* This is an array that decays to an r-value pointer */
!               CSemSetDecayedRValue(value, node->decayedType, node->type);
        }
        else
***************
*** 665,669 ****
        {
                /* This is an array that decays to an r-value pointer */
!               CSemSetRValue(value, node->decayedType);
        }
        else
--- 665,669 ----
        {
                /* This is an array that decays to an r-value pointer */
!               CSemSetDecayedRValue(value, node->decayedType, node->type);
        }
        else
***************
*** 897,901 ****
                {
                        /* The array element decays into a pointer, which is an 
r-value */
!                       CSemSetRValue(value1, elemType);
                }
                return value1;
--- 897,901 ----
                {
                        /* The array element decays into a pointer, which is an 
r-value */
!                       CSemSetDecayedRValue(value1, elemType, rawElemType);
                }
                return value1;

Index: c_oper.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/c/c_oper.tc,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** c_oper.tc   21 Oct 2002 01:33:25 -0000      1.22
--- c_oper.tc   5 Nov 2002 23:58:27 -0000       1.23
***************
*** 2117,2121 ****
        /* Perform semantic analysis on the argument */
        value = ILNode_CSemAnalysis(node->expr, info, &(node->expr), stmtLevel);
!       if(!CSemIsLValue(value) || CSemIsNoRef(value))
        {
                if(!CSemIsError(value))
--- 2117,2129 ----
        /* Perform semantic analysis on the argument */
        value = ILNode_CSemAnalysis(node->expr, info, &(node->expr), stmtLevel);
!       if(CSemIsDecayed(value))
!       {
!               /* The argument was an array that just decayed into a pointer.
!                  Convert it into a pointer to the entire array */
!               CSemSetRValue(value, CTypeCreatePointer
!                               (info, CSemGetDecayedType(value)));
!               return value;
!       }
!       else if(!CSemIsLValue(value) || CSemIsNoRef(value))
        {
                if(!CSemIsError(value))





reply via email to

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