This is an archive of the discontinued LLVM Phabricator instance.

[FE][AIX] Emit error for oversized long long bitfield under 32bit mode
AbandonedPublic

Authored by Xiangling_L on Oct 8 2020, 6:57 AM.

Diff Detail

Event Timeline

Xiangling_L requested review of this revision.Oct 8 2020, 6:57 AM
Xiangling_L created this revision.
Xiangling_L retitled this revision from [AIX] Emit error for oversized long long bitfield under 32bit mode to [FE][AIX] Emit error for oversized long long bitfield under 32bit mode.Oct 8 2020, 7:37 AM

Thanks for splitting this out XiangLing.

clang/lib/Sema/SemaDecl.cpp
16452

Comment explaining why we need to emit the extra error in this case for AIX.

16454

I would rearrange the order of the conditions so that we first check if we are on AIX for the short-circuiting.

16456

Maybe Value.ugt(32) instead of (unsigned)Value.getZExtValue() > 32

clang/test/Layout/aix-oversized-bitfield.cpp
1

I believe this is running the test twice as C++/

Xiangling_L abandoned this revision.Nov 25 2020, 1:52 PM

As we discussed offline, the strategy to handle long long type bitfield under 32bit mode would be the bitcontainer shall be 32-bits unless if a single long long bitfield has length greater than 32 bits (what would have been a diagnostic in xlc/xlclang/xlclang++), then the bitcontainer shall be 64-bits.