[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)
commit640015cbc3c371ad196b9252ca85e59436ddf17e
treea288d0e15330fa06f9f783079de74e9a51038e3c
parenta4bb4b9f0ba15f6d5c4e37a5db4f72a6388a6a2f
[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.

llvm-svn: 198900
clang/lib/AST/RecordLayoutBuilder.cpp
clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
clang/test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp [new file with mode: 0755]