Skip to content
Commit 651e5ae6 authored by Reid Kleckner's avatar Reid Kleckner
Browse files

[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
parent a5cd1981
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment