[MS] Fix passing aligned records by value in some cases
It's not exactly clear what the meaning of TypeInfo::AlignRequirement is, so go directly to the ASTRecordLayout for records and check the required alignment there. Compare that number with the stack alignment value of 4. This fixes cases when the alignment attribute does not appear directly on the record [1], or when the attribute on the record is underaligned [2]. [1]: `struct Foo { int __declspec(align(16)) x; };` [2]: `struct __declspec(align(1)) Bar { int x; };` Fixes https://llvm.org/pr63257 Differential Revision: https://reviews.llvm.org/D152752
Loading
Please sign in to comment