[cfe-commits] r79968 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Anders Carlsson andersca at mac.com
Mon Aug 24 19:07:02 PDT 2009


Author: andersca
Date: Mon Aug 24 21:07:02 2009
New Revision: 79968

URL: http://llvm.org/viewvc/llvm-project?rev=79968&view=rev
Log:
Fix ivar layout map generation (hopefully).

Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=79968&r1=79967&r2=79968&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Aug 24 21:07:02 2009
@@ -3050,7 +3050,12 @@
     if (RD) {
       if (Field->isBitField()) {
         CodeGenTypes::BitFieldInfo Info = CGM.getTypes().getBitFieldInfo(Field);
-        FieldOffset = Layout->getElementOffset(Info.FieldNo);
+        
+        const llvm::Type *Ty = 
+          CGM.getTypes().ConvertTypeForMemRecursive(Field->getType());
+        uint64_t TypeSize = 
+          CGM.getTypes().getTargetData().getTypeAllocSize(Ty);
+        FieldOffset = Info.FieldNo * TypeSize;
       } else
         FieldOffset =
           Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));





More information about the cfe-commits mailing list