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_coerce.c,1.23,1.24


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/codegen cg_coerce.c,1.23,1.24
Date: Sun, 22 Jun 2003 09:48:12 -0400

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

Modified Files:
        cg_coerce.c 
Log Message:
Fix indirect casting to use a 3 step conversion instead of obtaining rules.


Index: cg_coerce.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_coerce.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** cg_coerce.c 8 May 2003 20:22:40 -0000       1.23
--- cg_coerce.c 22 Jun 2003 13:48:10 -0000      1.24
***************
*** 630,636 ****
  static int GetIndirectConvertRules(ILGenInfo *info, ILType *fromType,
                                                   ILType *toType, int explicit,
!                                                  int kinds, ConvertRules 
*rules1,
!                                                  ConvertRules *rules2,
!                                                  ILType **itype1,ILType 
**itype2)
  {
        ILMethod *method;
--- 630,634 ----
  static int GetIndirectConvertRules(ILGenInfo *info, ILType *fromType,
                                                   ILType *toType, int explicit,
!                                                  int kinds, ILType 
**itype1,ILType **itype2)
  {
        ILMethod *method;
***************
*** 741,746 ****
                if(itype1)(*itype1)=argType;
                if(itype2)(*itype2)=returnType;
-               GetConvertRules(info,fromType,argType,0,kinds,rules1);
-               GetConvertRules(info,returnType,toType,0,kinds,rules2);
                return 1;
        }
--- 739,742 ----
***************
*** 843,848 ****
                if(itype1)(*itype1)=argType;
                if(itype2)(*itype2)=returnType;
-               GetConvertRules(info,fromType,argType,0,kinds,rules1);
-               GetConvertRules(info,returnType,toType,0,kinds,rules2);
                return 1;
        }
--- 839,842 ----
***************
*** 1017,1021 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 0, IL_CONVERT_ALL, &rules))
        {
--- 1011,1014 ----
***************
*** 1023,1027 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType, 
!                                                       0, 
IL_CONVERT_ALL,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1016,1020 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType, 
!                                                                               
                0, IL_CONVERT_ALL,NULL,NULL))
        {
                return 1;
***************
*** 1034,1038 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 0, kinds, &rules))
        {
--- 1027,1030 ----
***************
*** 1040,1044 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                       
kinds,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1032,1036 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                                               
                kinds,NULL,NULL))
        {
                return 1;
***************
*** 1051,1055 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 0, IL_CONVERT_ALL, &rules))
        {
--- 1043,1046 ----
***************
*** 1061,1065 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                       
IL_CONVERT_ALL,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1052,1056 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                                               
                IL_CONVERT_ALL,NULL,NULL))
        {
                return 1;
***************
*** 1076,1080 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 0, kinds, &rules))
        {
--- 1067,1070 ----
***************
*** 1087,1091 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                       
kinds,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1077,1081 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                                               
                kinds,NULL,NULL))
        {
                return 1;
***************
*** 1101,1105 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        ILType *t1,*t2;
        ILMachineType constType;
--- 1091,1094 ----
***************
*** 1116,1124 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                       
IL_CONVERT_ALL,&rules,&rules2,&t1,&t2))
        {
!               ApplyRules(info, node, parent, &rules, t1);
                ILCoerce(info,*parent,parent,t1,t2,0);
!               ApplyRules(info, *parent, parent, &rules2, toType);
                return 1;
        }
--- 1105,1113 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                                               
                IL_CONVERT_ALL,&t1,&t2))
        {
!               ILCoerce(info,*parent,parent,fromType,t1,0);
                ILCoerce(info,*parent,parent,t1,t2,0);
!               ILCoerce(info,*parent,parent,t2,toType,0);
                return 1;
        }
***************
*** 1133,1137 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        ILMachineType constType;
        ILType *t1,*t2;
--- 1122,1125 ----
***************
*** 1149,1157 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                               
kinds,&rules,&rules2,&t1,&t2))
        {
!               ApplyRules(info, node, parent, &rules, t1);
                ILCoerceKind(info,*parent,parent,t1,t2,kinds,0);
!               ApplyRules(info, *parent, parent, &rules2, toType);
                return 1;
        }
--- 1137,1145 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                                               
                kinds,&t1,&t2))
        {
!               ILCoerceKind(info,*parent,parent,fromType,t1,kinds,0);
                ILCoerceKind(info,*parent,parent,t1,t2,kinds,0);
!               ILCoerceKind(info,*parent,parent,t2,toType,kinds,0);
                return 1;
        }
***************
*** 1165,1175 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 1, IL_CONVERT_ALL, &rules))
        {
                return 1;
        }
!       else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
!                                                       
IL_CONVERT_ALL,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1153,1162 ----
  {
        ConvertRules rules;
        if(GetConvertRules(info, fromType, toType, 1, IL_CONVERT_ALL, &rules))
        {
                return 1;
        }
!       else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                               
                IL_CONVERT_ALL,NULL,NULL))
        {
                return 1;
***************
*** 1182,1186 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        if(GetConvertRules(info, fromType, toType, 1, kinds, &rules))
        {
--- 1169,1172 ----
***************
*** 1188,1192 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                       
kinds,&rules,&rules2,NULL,NULL))
        {
                return 1;
--- 1174,1178 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                               
                kinds,NULL,NULL))
        {
                return 1;
***************
*** 1199,1203 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        ILType *t1,*t2;
        if(GetConvertRules(info, fromType, toType, 1, IL_CONVERT_ALL, &rules))
--- 1185,1188 ----
***************
*** 1207,1215 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                       
IL_CONVERT_ALL,&rules,&rules2,&t1,&t2))
        {
!               ApplyRules(info, node, parent, &rules, t1);
                ILCast(info,*parent,parent,t1,t2,0);
!               ApplyRules(info, *parent, parent, &rules2, toType);
                return 1;
        }
--- 1192,1200 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                               
                IL_CONVERT_ALL,&t1,&t2))
        {
!               ILCast(info,*parent,parent,fromType,t1,0);
                ILCast(info,*parent,parent,t1,t2,0);
!               ILCast(info,*parent,parent,t2,toType,0);
                return 1;
        }
***************
*** 1225,1229 ****
  {
        ConvertRules rules;
-       ConvertRules rules2;
        ILType *t1,*t2;
        if(GetConvertRules(info, fromType, toType, 1, kinds, &rules))
--- 1210,1213 ----
***************
*** 1233,1241 ****
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                       
kinds,&rules,&rules2,&t1,&t2))
        {
!               ApplyRules(info, node, parent, &rules, t1);
                ILCastKind(info,*parent,parent,t1,t2,kinds,0);
!               ApplyRules(info, *parent, parent, &rules2, toType);
                return 1;
        }
--- 1217,1225 ----
        }
        else if(indirect && GetIndirectConvertRules(info,fromType,toType,1, 
!                                                                               
                kinds,&t1,&t2))
        {
!               ILCastKind(info,*parent,parent,fromType,t1,kinds,0);
                ILCastKind(info,*parent,parent,t1,t2,kinds,0);
!               ILCastKind(info,*parent,parent,t2,toType,kinds,0);
                return 1;
        }





reply via email to

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