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_grammar.y,1.45,1.46


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/c c_grammar.y,1.45,1.46
Date: Tue, 15 Apr 2003 21:54:48 -0400

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

Modified Files:
        c_grammar.y 
Log Message:


ProcessBitField: remove enum wrappers from a bit field type (Bug #2777).


Index: c_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/c/c_grammar.y,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** c_grammar.y 12 Mar 2003 07:58:52 -0000      1.45
--- c_grammar.y 16 Apr 2003 01:54:45 -0000      1.46
***************
*** 191,194 ****
--- 191,195 ----
        ILType *type;
        ILType *baseType;
+       ILType *nonEnumType;
        ILUInt32 maxSize;
        int typeInvalid;
***************
*** 197,202 ****
        type = CDeclFinalize(&CCCodeGen, spec, decl, 0, 0);
  
!       /* Make sure that the type is integer and that the size is in range */
        baseType = ILTypeStripPrefixes(type);
        typeInvalid = 0;
        if(ILType_IsPrimitive(baseType))
--- 198,220 ----
        type = CDeclFinalize(&CCCodeGen, spec, decl, 0, 0);
  
!       /* Get the base type, removing prefixes and enum wrappers */
        baseType = ILTypeStripPrefixes(type);
+       nonEnumType = ILTypeGetEnumType(baseType);
+       if(nonEnumType != baseType)
+       {
+               baseType = nonEnumType;
+               if(CTypeIsConst(type))
+               {
+                       baseType = CTypeAddConst(&CCCodeGen, baseType);
+               }
+               if(CTypeIsVolatile(type))
+               {
+                       baseType = CTypeAddVolatile(&CCCodeGen, baseType);
+               }
+               type = baseType;
+               baseType = ILTypeStripPrefixes(type);
+       }
+ 
+       /* Make sure that the type is integer and that the size is in range */
        typeInvalid = 0;
        if(ILType_IsPrimitive(baseType))





reply via email to

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