[PATCH] D32001: [APInt] Reorder fields to avoid a hole in the middle of the class

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:42:58 PDT 2017


davide added a comment.

In https://reviews.llvm.org/D32001#726060, @hans wrote:

> In https://reviews.llvm.org/D32001#725651, @davide wrote:
>
> > I wonder if there's an easy way of testing this so that it doesn't break in the future? Maybe an unit test checking `sizeof()`. Thoughts?
>
>
> Clang (and GCC too I think) has a -Wpadded parning. Maybe we could #pragma enable it around this class? We have a lot of classes that are supposed to be carefully packed though.


Maybe, I still prefer a `static_assert<>` but I don't have a strong preference.


Repository:
  rL LLVM

https://reviews.llvm.org/D32001





More information about the llvm-commits mailing list