]> granicus.if.org Git - clang/commit
[ms-abi] Fixing CGRecordLayoutBuilder w.r.t. MS NonVirutalBase Layout
authorWarren Hunt <whunt@google.com>
Thu, 9 Jan 2014 23:51:31 +0000 (23:51 +0000)
committerWarren Hunt <whunt@google.com>
Thu, 9 Jan 2014 23:51:31 +0000 (23:51 +0000)
commit4df754d1530e70e5719cfd00b515cbfa8dbbe59f
tree44c8218c69f1fb248dabf7b4ffe4b45a2efc01bf
parent27db771559cc2edd915b098a739d00b2a0bff13c
[ms-abi] Fixing CGRecordLayoutBuilder w.r.t. MS NonVirutalBase Layout

The MS abi lays out *all* non-virtual bases with leading vfptrs before
laying out non-virutal bases without vfptrs.  This guarantees that the
primary base is laid out first.  r198818 fixed RecordLayoutBuilder to
produce compatiable layouts.  This patch fixes CGRecordLayoutBuilder to
be able to consume those layouts and produce meaningful output without
tripping any asserts about assumed incoming layout.

A test case is included that shows CGRecordLayoutBuilder in fact
produces output in the compatiable order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198900 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/RecordLayoutBuilder.cpp
lib/CodeGen/CGRecordLayoutBuilder.cpp
test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp [new file with mode: 0755]