<div dir="ltr">Hi,<div><br></div><div><div>When doing int<->ptr coercion for big-endian architectures, the shift amount is currently incorrectly calculated.</div><div> </div><div>The shift amount is based upon DataLayout::getTypeAllocSizeInBits. This will only work for legal types - types such as i24 that are created as part of structs for bitfields will return "32" from that function. This patch changes to using getTypeSizeInBits.</div>
<div> </div><div>It turns out that AArch64 didn't run across this problem because it always returned [1 x i64] as the type for a bitfield, whereas ARM64 returns i64 so goes down this (better, but wrong) codepath.</div>
<div><br></div><div>I'm almost certain this change is good, but as I'm not a clang expert and this is generic (big-endian only though) code, I'd appreciate if someone else would also give it the once-over.</div>
<div><br></div><div>Cheers,</div><div><br></div><div>James</div></div></div>