[llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Dale Johannesen
dalej at apple.com
Mon Jul 14 13:15:34 PDT 2008
Author: johannes
Date: Mon Jul 14 15:15:32 2008
New Revision: 53572
URL: http://llvm.org/viewvc/llvm-project?rev=53572&view=rev
Log:
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/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=53572&r1=53571&r2=53572&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 14 15:15:32 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