[cfe-dev] struct copy

Chris Lattner clattner at apple.com
Sun Sep 28 13:01:39 PDT 2008

On Sep 28, 2008, at 11:59 AM, Argiris Kirtzidis wrote:
>> Note that the llvm type for struct.c doesn't have members that  
>> fully overlap "int I".
> Ah ok, "unions as the biggest field" is bad. How about if we  
> consider unions as arrays (as clang does):
>   %struct.a = type { i8, double }
>   %struct.c = type [12 x i8]

That would solve this problem, but also isn't a universally good thing  
to do.  Doing things like this can break the (critical for some codes)  
Scalar Replacement of Aggregates optimization.  In general, it is good  
for the front-end to preserve as much accurate type info in the LLVM  
IR as possible.


More information about the cfe-dev mailing list