[cfe-commits] [PATCH] simplify the bitfield codegen (for review)

Devang Patel dpatel at apple.com
Mon Jan 21 14:12:18 PST 2008


On Jan 21, 2008, at 1:09 PM, Lauro Ramos Venancio wrote:

> <bitfield.patch>


@@ -78,18 +78,11 @@

    class BitFieldInfo {
    public:
-    explicit BitFieldInfo(unsigned N, unsigned B, unsigned E)
-      : No(N), Begin(B), End(E) {}
-  private:
-    // No -  llvm struct field number that is used to
-    // access this field. It may be not same as struct field number.
-    // For example,
-    //   struct S { char a; short b:2; }
-    // Here field 'b' is second field however it is accessed as
-    // 9th and 10th bitfield of first field whose type is short.
-    unsigned No;
+    explicit BitFieldInfo(unsigned B, unsigned S)
+      : Begin(B), Size(S) {}
+
      unsigned Begin;
-    unsigned End;
+    unsigned Size;
    };
    llvm::DenseMap<const FieldDecl *, BitFieldInfo> BitFields;


Why are you removing 'No' field here ?

-
Devang






More information about the cfe-commits mailing list