[AIX] Implement AIX special alignment rule about double/long double
authorXiangling Liao <Xiangling.Liao@ibm.com>
Tue, 2 Jun 2020 15:51:58 +0000 (11:51 -0400)
committerXiangling Liao <Xiangling.Liao@ibm.com>
Mon, 27 Jul 2020 19:13:03 +0000 (15:13 -0400)
commit05ad8e942996f36cc694478542ccd84aa5bbb80f
tree5223b310e6e9352e8d23acba10c05ac2d24d58f1
parentbef19abcf7e2807f8b48b00445b221ff20dd3923
[AIX] Implement AIX special alignment rule about double/long double

Implement AIX default `power` alignment rule by adding `PreferredAlignment` and
`PreferredNVAlignment` in ASTRecordLayout class.

The patchh aims at returning correct value for `__alignof(x)` and `alignof(x)`
under `power` alignment rules.

Differential Revision: https://reviews.llvm.org/D79719
15 files changed:
clang/include/clang/AST/RecordLayout.h
clang/include/clang/Basic/TargetInfo.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/RecordLayout.cpp
clang/lib/AST/RecordLayoutBuilder.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/PPC.h
clang/test/Layout/aix-Wpacked-expecting-diagnostics.cpp [new file with mode: 0644]
clang/test/Layout/aix-Wpacked-no-diagnostics.cpp [new file with mode: 0644]
clang/test/Layout/aix-double-struct-member.cpp [new file with mode: 0644]
clang/test/Layout/aix-no-unique-address-with-double.cpp [new file with mode: 0644]
clang/test/Layout/aix-pack-attr-on-base.cpp [new file with mode: 0644]
clang/test/Layout/aix-power-alignment-typedef-2.cpp [new file with mode: 0644]
clang/test/Layout/aix-power-alignment-typedef.cpp [new file with mode: 0644]
clang/test/Layout/aix-virtual-function-and-base-with-double.cpp [new file with mode: 0644]