[llvm-commits] [llvm-gcc-4.2] r134830 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-linker-hack.cpp llvm-types.cpp

Chris Lattner clattner at apple.com
Sun Jul 24 11:10:57 PDT 2011


On Jul 24, 2011, at 9:44 AM, Duncan Sands wrote:

> Hi Chris,
> 
>> --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
>> +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Jul  9 12:41:47 2011
>> @@ -8582,8 +8582,15 @@
>>      LayoutInfo.HandleTailPadding(getInt64(StructTypeSizeTree, true));
>> 
>>    // Okay, we're done, return the computed elements.
>> -  return ConstantStruct::getAnon(Context, LayoutInfo.ResultElts,
>> -                                 LayoutInfo.StructIsPacked);
>> +  Constant *Result = ConstantStruct::getAnon(Context, LayoutInfo.ResultElts,
>> +                                             LayoutInfo.StructIsPacked);
>> +
>> +  // This is a hack for brokenness in the objc frontend.
>> +  const StructType *LLVMTy = dyn_cast<StructType>(ConvertType(TREE_TYPE(exp)));
>> +  if (LLVMTy&&  !LLVMTy->isAnonymous()&&
>> +      cast<StructType>(Result->getType())->isLayoutIdentical(LLVMTy))
>> +    Result = ConstantStruct::get(LLVMTy, LayoutInfo.ResultElts);
>> +  return Result;
>>  }
> 
> do you remember what this is about?  Do you have a testcase?

I don't have a testcase.  IIRC, the ObjC frontend was making metadata whose initializer had a different type than the global variable backing it.

-Chris



More information about the llvm-commits mailing list