On Feb 11, 2008, at 12:10 PM, Duncan Sands wrote: > Hi Dale, > >> Treat struct { long long: 29; }; as int sized and >> aligned, rather than long long. ABI issue. > > if you look at the DECL_SIZE of the bitfield, rather than > the type size, I think it gives you 29. If so, DECL_SIZE > should simplify things for you. In fact as far as I can > see you should never use the type size for a record field. > For example the struct conversion stuff uses DECL_SIZE everywhere > (except at one point in the field indexing - I have a patch to fix > that which I'll apply at some point). Not using the type size > makes all these "it's a big type shoved in a small place" problems > magically go away.
I'm not sure what your suggestion is exactly; the issue isn't the size, it is that the code in HandleArgument for general RECORD_TYPEs is looking at getDeclaredType, not the type in the field. (So what this patch does is use the INTEGER_REGS case instead.) The wide use of getDeclaredType and the comments describing it make me think it would be unsafe in general to change that. It would certainly be more elegant if it works, though. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits