On 14-02-12 22:21, Stephan Tolksdorf wrote:
On 14-02-12 20:45, David Majnemer wrote:
This looks like the right place to fix the bug.
Three comments:
- The '*' for pointer types should be on the right side.
- AlignedAttr::getMaxAlignment() isn't always super fast but I guess
such typedefs are rare. An argument could be made that getTypeInfoImpl
should return a struct containing the size, alignment and whether or not
the type has an explicit alignment. Then, getPreferredTypeAlign() could
take advantage of it.
- Both of your tests in CodeGen/alignment.c already pass without your
patch.
Thanks a lot for the review!
I've moved the '*' to the right and split off the alignment.c changes
into a separate patch.
I suppose that typedefs with attributes are so rare that the overhead of
the new getMaxAlignment call should be minimal.
Please commit the patches if you think they are ready. (I don't have
commit access.)
Ping.
If you're concerned about the performance, I could also move the
getMaxAlignment call into the 'if (T == double || T == long long ||
...)' statement below and only call getMaxAlignment if ABIAlign !=
getTypeSize(T).
- Stephan
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits