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

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

[Dotgnu-pnet-commits] CVS: pnet/dumpasm dump_flags.c,1.6,1.7 dump_type.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/dumpasm dump_flags.c,1.6,1.7 dump_type.c,1.8,1.9
Date: Tue, 18 Feb 2003 00:25:12 -0500

Update of /cvsroot/dotgnu-pnet/pnet/dumpasm
In directory subversions:/tmp/cvs-serv8588/dumpasm

Modified Files:
        dump_flags.c dump_type.c 
Log Message:


Add support for Generic IL to "image", "ilasm", and "ildasm"; some
syntax extensions for Generic C#, but no semantic analysis (yet).


Index: dump_flags.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/dumpasm/dump_flags.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** dump_flags.c        30 Jan 2003 10:16:45 -0000      1.6
--- dump_flags.c        18 Feb 2003 05:25:08 -0000      1.7
***************
*** 232,236 ****
        {"*property", IL_META_CALLCONV_PROPERTY, IL_META_CALLCONV_MASK},
        {"*unmanaged", IL_META_CALLCONV_UNMGD, IL_META_CALLCONV_MASK},
!       {"*callconvA", 0x0A, IL_META_CALLCONV_MASK},
        {"*callconvB", 0x0B, IL_META_CALLCONV_MASK},
        {"*callconvC", 0x0C, IL_META_CALLCONV_MASK},
--- 232,236 ----
        {"*property", IL_META_CALLCONV_PROPERTY, IL_META_CALLCONV_MASK},
        {"*unmanaged", IL_META_CALLCONV_UNMGD, IL_META_CALLCONV_MASK},
!       {"/instantiation", IL_META_CALLCONV_INSTANTIATION, 
IL_META_CALLCONV_MASK},
        {"*callconvB", 0x0B, IL_META_CALLCONV_MASK},
        {"*callconvC", 0x0C, IL_META_CALLCONV_MASK},
***************
*** 238,241 ****
--- 238,242 ----
        {"*callconvE", 0x0E, IL_META_CALLCONV_MASK},
        {"*callconvF", 0x0F, IL_META_CALLCONV_MASK},
+       {"/generic", IL_META_CALLCONV_GENERIC, 0},
        {"instance", IL_META_CALLCONV_HASTHIS, 0},
        {"explicit", IL_META_CALLCONV_EXPLICITTHIS, 0},

Index: dump_type.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/dumpasm/dump_type.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dump_type.c 19 Aug 2002 03:23:39 -0000      1.8
--- dump_type.c 18 Feb 2003 05:25:08 -0000      1.9
***************
*** 277,280 ****
--- 277,314 ----
                        break;
  
+                       case IL_TYPE_COMPLEX_WITH:
+                       {
+                               unsigned long numParams;
+                               unsigned long param;
+                               ILDumpType(stream, image,
+                                                  
ILTypeGetWithMainWithPrefixes(type), flags);
+                               putc('<', stream);
+                               numParams = ILTypeNumWithParams(type);
+                               for(param = 1; param <= numParams; ++param)
+                               {
+                                       if(param != 1)
+                                       {
+                                               fputs(", ", stream);
+                                       }
+                                       ILDumpType(stream, image,
+                                                          
ILTypeGetWithParamWithPrefixes(type, param),
+                                                          flags);
+                               }
+                               putc('>', stream);
+                       }
+                       break;
+ 
+                       case IL_TYPE_COMPLEX_MVAR:
+                       {
+                               fprintf(stream, "!!%d", ILType_VarNum(type));
+                       }
+                       break;
+ 
+                       case IL_TYPE_COMPLEX_VAR:
+                       {
+                               fprintf(stream, "!%d", ILType_VarNum(type));
+                       }
+                       break;
+ 
                        default:
                        {
***************
*** 456,459 ****
--- 490,506 ----
        ILUInt32 callingConventions;
        ILType *synType;
+       int dumpGenerics;
+       ILUInt32 genericNum;
+       ILGenericPar *genPar;
+       const char *name;
+       ILProgramItem *constraint;
+       ILTypeSpec *spec;
+ 
+       /* Determine if we need to dump the generic parameters */
+       dumpGenerics = ((flags & IL_DUMP_GENERIC_PARAMS) != 0);
+ 
+       /* Strip off the "generic parameters" flag so that we don't
+          end up passing it down to the parameter types */
+       flags &= ~IL_DUMP_GENERIC_PARAMS;
  
        /* Dump the calling conventions for the method */
***************
*** 489,492 ****
--- 536,589 ----
        {
                putc('*', stream);
+       }
+ 
+       /* Dump the generic method parameters if necessary */
+       if(dumpGenerics && methodInfo)
+       {
+               genericNum = 0;
+               genPar = ILGenericParGetFromOwner
+                               (ILToProgramItem(methodInfo), genericNum);
+               if(genPar)
+               {
+                       putc('<', stream);
+                       do
+                       {
+                               if(genericNum > 0)
+                               {
+                                       fputs(", ", stream);
+                               }
+                               constraint = ILGenericPar_Constraint(genPar);
+                               if(constraint)
+                               {
+                                       putc('(', stream);
+                                       spec = 
ILProgramItemToTypeSpec(constraint);
+                                       if(spec)
+                                       {
+                                               ILDumpType(stream, image,
+                                                                  
ILTypeSpec_Type(spec), flags);
+                                       }
+                                       else
+                                       {
+                                               ILDumpType(stream, image,
+                                                                  
ILClassToType((ILClass *)constraint), flags);
+                                       }
+                                       putc(')', stream);
+                               }
+                               name = ILGenericPar_Name(genPar);
+                               if(name)
+                               {
+                                       ILDumpIdentifier(stream, name, 0, 
flags);
+                               }
+                               else
+                               {
+                                       fprintf(stream, "G_%d", 
(int)(genericNum + 1));
+                               }
+                               ++genericNum;
+                               genPar = ILGenericParGetFromOwner
+                                       (ILToProgramItem(info), genericNum);
+                       }
+                       while(genPar != 0);
+                       putc('>', stream);
+               }
        }
  





reply via email to

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