[llvm-commits] [llvm-gcc-4.2] r53699 - /llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp

Bill Wendling isanbard at gmail.com
Wed Jul 16 12:55:39 PDT 2008


Author: void
Date: Wed Jul 16 14:55:39 2008
New Revision: 53699

URL: http://llvm.org/viewvc/llvm-project?rev=53699&view=rev
Log:
Pull r53572 into Gaz:

Fix code generation for bitfields in ObjC2.  Fixes
objc.dg/bitfield-1.m
obj-c++.dg/bitfield-2.mm
(in 64-bit mode).


Modified:
    llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp?rev=53699&r1=53698&r2=53699&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp Wed Jul 16 14:55:39 2008
@@ -5753,6 +5753,12 @@
   } else {
     Value *Offset = Emit(field_offset, 0);
 
+    // For ObjC2, we may have a base class field that should not be taken into
+    // account here, as it is already in Offset.  The ObjC FE figures this out.
+    tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp);
+    if (field_bit_offset) {
+      BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset);
+    }
     // Here BitStart gives the offset of the field in bits from field_offset.
     // Incorporate as much of it as possible into the pointer computation.
     unsigned ByteOffset = BitStart/8;





More information about the llvm-commits mailing list