diff options
| author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-03-13 13:38:12 +0000 |
|---|---|---|
| committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-03-13 13:38:12 +0000 |
| commit | 867c2a7d369c6a067cadead7cd94ad5b391f14b4 (patch) | |
| tree | f89c44f8aeecdfca51685cda3d31190d3d8c1c83 /clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout | |
| parent | 0c1e5aacd35f42fdce2fdacb0e278d7879caf529 (diff) | |
| download | bcm5719-llvm-867c2a7d369c6a067cadead7cd94ad5b391f14b4.tar.gz bcm5719-llvm-867c2a7d369c6a067cadead7cd94ad5b391f14b4.zip | |
[AST] Improve support of external layouts in `MicrosoftRecordLayoutBuilder`
Summary:
This patch fixes several small problems with external layouts support in
`MicrosoftRecordLayoutBuilder`:
- aligns properly the size of a struct that ends with a bit field. It was
aligned on byte before, not on the size of the field, so the struct size was
smaller than it should be;
- adjusts the struct size when injecting a vbptr in the case when there were no
bases or fields allocated after the vbptr. Similarly, without the adjustment
the struct was smaller than it should be;
- the same fix as above for the vfptr.
All these fixes affect the non-virtual size of a struct, so they are tested
through non-virtual inheritance.
Reviewers: rnk, zturner, rsmith
Reviewed By: rnk
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58544
llvm-svn: 356047
Diffstat (limited to 'clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout')
| -rw-r--r-- | clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout b/clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout new file mode 100644 index 00000000000..71d88c1e603 --- /dev/null +++ b/clang/test/CodeGenCXX/Inputs/override-layout-virtual-base.layout @@ -0,0 +1,8 @@ + +*** Dumping AST Record Layout +Type: struct S2 + +Layout: <ASTRecordLayout + Size:64 + Alignment:64 + FieldOffsets: []> |

