From 867c2a7d369c6a067cadead7cd94ad5b391f14b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Urakov Date: Wed, 13 Mar 2019 13:38:12 +0000 Subject: [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 --- clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout') diff --git a/clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout b/clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout index 8e67dce6502..b57c6efbc13 100644 --- a/clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout +++ b/clang/test/CodeGenCXX/Inputs/override-bit-field-layout.layout @@ -14,3 +14,11 @@ Layout: + +*** Dumping AST Record Layout +Type: struct S3 + +Layout: -- cgit v1.2.3