]> granicus.if.org Git - clang/commit
[ms-cxxabi] Emit and install appropriately mangled vbtables
authorReid Kleckner <reid@kleckner.net>
Wed, 19 Jun 2013 15:20:38 +0000 (15:20 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 19 Jun 2013 15:20:38 +0000 (15:20 +0000)
commit9063302a82423cb83f002257a416741850739a70
treea34a1643da1c9744899e788d8be08b90f895a336
parent4cd90dfbf4e6ddfb34c4c14c2e06ac9fca6154d8
[ms-cxxabi] Emit and install appropriately mangled vbtables

In Itanium, dynamic classes have one vtable with several different
address points for dynamic base classes that can't share vtables.

In the MS C++ ABI, each vbtable that can't be shared gets its own
symbol, similar to how ctor vtables work in Itanium.  However, instead
of mangling the subobject offset into the symbol, the unique portions of
the inheritance path are mangled into the symbol to make it unique.

This patch implements the MSVC 2012 scheme for forming unique vbtable
symbol names.  MSVC 2010 use the same mangling with a different subset
of the path.  Implementing that mangling and possibly others is TODO.

Each vbtable is an array of i32 offsets from the vbptr that points to it
to another virtual base subobject.  The first entry of a vbtable always
points to the base of the current subobject, implying that it is the
same no matter which parent class contains it.

Reviewers: rjmccall

Differential Revision: http://llvm-reviews.chandlerc.com/D636

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184309 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/AST/Mangle.h
lib/AST/ItaniumMangle.cpp
lib/AST/MicrosoftMangle.cpp
lib/CodeGen/CGCXXABI.cpp
lib/CodeGen/CGCXXABI.h
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CMakeLists.txt
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
lib/CodeGen/MicrosoftVBTables.cpp [new file with mode: 0644]
lib/CodeGen/MicrosoftVBTables.h [new file with mode: 0644]
test/CodeGenCXX/microsoft-abi-structors.cpp
test/CodeGenCXX/microsoft-abi-vbtables.cpp [new file with mode: 0644]