[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
Duncan Sands
baldrick at free.fr
Sun Jul 24 09:44:31 PDT 2011
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?
Thanks, Duncan.
More information about the llvm-commits
mailing list