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

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

[Dotgnu-pnet-commits] CVS: pnet/codegen cg_lvalue.tc,1.21,1.22 cg_nodes


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/codegen cg_lvalue.tc,1.21,1.22 cg_nodes.tc,1.79,1.80
Date: Fri, 30 May 2003 01:16:02 -0400

Update of /cvsroot/dotgnu-pnet/pnet/codegen
In directory subversions:/tmp/cvs-serv24016/codegen

Modified Files:
        cg_lvalue.tc cg_nodes.tc 
Log Message:


Implement code generation and semantic analysis for ILNode_DerefField.


Index: cg_lvalue.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_lvalue.tc,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** cg_lvalue.tc        29 May 2003 16:58:33 -0000      1.21
--- cg_lvalue.tc        30 May 2003 05:16:00 -0000      1.22
***************
*** 218,222 ****
  ILNode_GenValue(ILNode_MemberAccess)
  {
!       /* TODO */
        return node->machineType;
  }
--- 218,222 ----
  ILNode_GenValue(ILNode_MemberAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
        return node->machineType;
  }
***************
*** 268,272 ****
  ILNode_GenValue(ILNode_DerefField)
  {
!       /* TODO */
        return node->machineType;
  }
--- 268,273 ----
  ILNode_GenValue(ILNode_DerefField)
  {
!       ILNode_GenValue(node->expr1, info);
!       ILGenFieldRef(info, IL_OP_LDFLD, node->field);
        return node->machineType;
  }
***************
*** 428,432 ****
  ILNode_Prepare(ILNode_MemberAccess)
  {
!       /* TODO */
        return node->machineType;
  }
--- 429,433 ----
  ILNode_Prepare(ILNode_MemberAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
        return node->machineType;
  }
***************
*** 437,441 ****
  ILNode_Prepare(ILNode_BaseAccess)
  {
!       /* TODO */
        return node->machineType;
  }
--- 438,442 ----
  ILNode_Prepare(ILNode_BaseAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
        return node->machineType;
  }
***************
*** 455,459 ****
  ILNode_Prepare(ILNode_DerefField)
  {
!       /* TODO */
        return node->machineType;
  }
--- 456,460 ----
  ILNode_Prepare(ILNode_DerefField)
  {
!       ILNode_GenValue(node->expr1, info);
        return node->machineType;
  }
***************
*** 604,608 ****
  ILNode_GetAndPrepare(ILNode_MemberAccess)
  {
!       /* TODO */
        return node->machineType;
  }
--- 605,609 ----
  ILNode_GetAndPrepare(ILNode_MemberAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
        return node->machineType;
  }
***************
*** 613,617 ****
  ILNode_GetAndPrepare(ILNode_BaseAccess)
  {
!       /* TODO */
        return node->machineType;
  }
--- 614,618 ----
  ILNode_GetAndPrepare(ILNode_BaseAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
        return node->machineType;
  }
***************
*** 631,635 ****
  ILNode_GetAndPrepare(ILNode_DerefField)
  {
!       /* TODO */
        return node->machineType;
  }
--- 632,661 ----
  ILNode_GetAndPrepare(ILNode_DerefField)
  {
!       ILNode_GenValue(node->expr1, info);
!       if(leave)
!       {
!               /* Duplicate the pointer reference and get the current value */
!               ILGenSimple(info, IL_OP_DUP);
!               ILGenAdjust(info, 1);
!               ILGenFieldRef(info, IL_OP_LDFLD, node->field);
! 
!               /* Store the current value into a temporary local */
!               node->tempVar = ILGenTempTypedVar(info, 
ILField_Type(node->field));
!               ILGenSimple(info, IL_OP_DUP);
!               ILGenStoreLocal(info, node->tempVar);
!               ILGenExtend(info, 1);
!       }
!       else
!       {
!               /* Duplicate the pointer reference for the later store */
!               ILGenSimple(info, IL_OP_DUP);
!               ILGenAdjust(info, 1);
! 
!               /* Load the current value from the field */
!               ILGenFieldRef(info, IL_OP_LDFLD, node->field);
! 
!               /* We don't need to reload a previous value in "Store" */
!               node->tempVar = IL_MAX_UINT32;
!       }
        return node->machineType;
  }
***************
*** 1154,1158 ****
  ILNode_Store(ILNode_MemberAccess)
  {
!       /* TODO */
  }
  
--- 1180,1184 ----
  ILNode_Store(ILNode_MemberAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
  }
  
***************
*** 1174,1185 ****
  
  /*
-  * Store into a field dereference destination.
-  */
- ILNode_Store(ILNode_DerefField)
- {
-       /* TODO */
- }
- 
- /*
   * Store into a static field reference.
   */
--- 1200,1203 ----
***************
*** 1198,1202 ****
   * Store into a member field reference.
   */
! ILNode_Store(ILNode_MemberField)
  {
        if(leave)
--- 1216,1221 ----
   * Store into a member field reference.
   */
! ILNode_Store(ILNode_MemberField),
! ILNode_Store(ILNode_DerefField)
  {
        if(leave)
***************
*** 1455,1459 ****
  ILNode_GenRef(ILNode_MemberAccess)
  {
!       /* TODO */
  }
  
--- 1474,1478 ----
  ILNode_GenRef(ILNode_MemberAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
  }
  
***************
*** 1463,1467 ****
  ILNode_GenRef(ILNode_BaseAccess)
  {
!       /* TODO */
  }
  
--- 1482,1486 ----
  ILNode_GenRef(ILNode_BaseAccess)
  {
!       /* Pseudo node - replaced during semantic analysis */
  }
  
***************
*** 1479,1483 ****
  ILNode_GenRef(ILNode_DerefField)
  {
!       /* TODO */
  }
  
--- 1498,1503 ----
  ILNode_GenRef(ILNode_DerefField)
  {
!       ILNode_GenValue(node->expr1, info);
!       ILGenFieldRef(info, IL_OP_LDFLDA, node->field);
  }
  

Index: cg_nodes.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_nodes.tc,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -r1.79 -r1.80
*** cg_nodes.tc 29 May 2003 16:58:33 -0000      1.79
--- cg_nodes.tc 30 May 2003 05:16:00 -0000      1.80
***************
*** 548,551 ****
--- 548,553 ----
  {
        %nocreate ILMachineType machineType = {ILMachineType_Void};
+       %nocreate ILField *field = {0};
+       %nocreate ILUInt32 tempVar = {0};
  }
  %node ILNode_StaticField ILNode_LValue =





reply via email to

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