[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 15:12:07 PDT 2008


On Jul 14, 2008, at 3:08 PMPDT, Chris Lattner wrote:

>
> On Jul 14, 2008, at 1:15 PM, Dale Johannesen wrote:
>
>> 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).
>
> Hey Dale,
>
> Does this build if you configure with --enable-languages=c (i.e., no
> objc support)?
>
> -Chris

Yes, see stub-objc.c.  There are other references in expr.c.

>> 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;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list