[PATCH] MS ABI: Improve selection of an inheritance model

David Majnemer david.majnemer at gmail.com
Wed Jan 15 00:56:58 PST 2014


Hi rnk, rsmith,

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.

http://llvm-reviews.chandlerc.com/D2548

Files:
  include/clang/AST/DeclCXX.h
  include/clang/Basic/Attr.td
  lib/AST/MicrosoftCXXABI.cpp
  lib/CodeGen/MicrosoftCXXABI.cpp
  lib/Sema/SemaType.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2548.1.patch
Type: text/x-patch
Size: 11307 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140115/3a99d51e/attachment.bin>


More information about the cfe-commits mailing list