]> granicus.if.org Git - clang/commit
MS ABI: Improve selection of an inheritance model
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 16 Jan 2014 20:05:57 +0000 (20:05 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 16 Jan 2014 20:05:57 +0000 (20:05 +0000)
commitfada0978a377b6c5c7b15cbeafeb51ffde2e5b89
tree05c59a715937190e90fe897e462aaf8611ca79ab
parentc43559325f5c0abc6b2af7afa3c8f5b9e8765683
MS ABI: Improve selection of an inheritance model

The MSVC ABI is rather finicky about the exact representation of it's
pointer-to-member representation.  The exact position of when and where
it will go with one representation versus another appears to be when it
desires the pointer-to-member to be complete.

To properly implement this in clang, do several things:
- Give up on tracking the polymorphic nature of the class.  It isn't
  useful to Sema and is only pertinent when choosing CodeGen-time
  details like whether the field-offset can be 0 instead of -1.
- Insist on locking-in the inheritance model when we ask our
  pointer-to-member type to be complete.  From there, grab the
  underlying CXXRecordDecl and try to make *that* complete.  Once we've
  done this, we can calculate it's inheritance model and apply it using
  an attribute.

N.B. My first bullet point is a lie.  We will eventually care about the
specifics of whether or not a CXXRecordDecl is or is not polymorphic
because MSVC compatible mangling of such things depends on it.  However,
I believe we will handle this in a rather different way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199416 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclCXX.h
include/clang/AST/Type.h
include/clang/Basic/Attr.td
lib/AST/MicrosoftCXXABI.cpp
lib/AST/Type.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
lib/Sema/SemaCast.cpp
lib/Sema/SemaType.cpp
test/SemaCXX/microsoft-abi-ptm.cpp [new file with mode: 0644]