[PATCH] Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft

Timur Iskhodzhanov timurrrr at google.com
Tue Aug 27 09:01:42 PDT 2013


Hi rnk, rjmccall,

Hi Reid, John,

Can you please review this patch?
It mostly moves the CGVTables code to ItaniumCXXABI.cpp and adds similar code to MicrosoftCXXABI.cpp

There are a couple of things left unfinished in this patch:

-- The vftable mangling is correct in most cases, but there are a couple of known cases when it isn't. This shouldn't be a problem yet, as there is a check that all the vftables of a given class have different mangled names and they are unique enough not to collide with the correct mangling. Worst case, it creates some extra sections to link into the executable.
Reid has agreed to finish the vftable mangling when this patch lands.

-- The lib/CodeGen/CGExprConstant.cpp part isn't studied carefully. I do plan to take a look there before committing, just thought this is a minor issue, so we can start reviewing the 99% of the patch earlier.

Thanks!
Timur

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

Files:
  lib/AST/VTableBuilder.cpp
  lib/AST/MicrosoftMangle.cpp
  lib/AST/ItaniumMangle.cpp
  lib/CodeGen/CGCXXABI.h
  lib/CodeGen/CGCXX.cpp
  lib/CodeGen/CodeGenModule.h
  lib/CodeGen/CGExprConstant.cpp
  lib/CodeGen/CGDebugInfo.cpp
  lib/CodeGen/CGClass.cpp
  lib/CodeGen/MicrosoftCXXABI.cpp
  lib/CodeGen/ItaniumCXXABI.cpp
  lib/CodeGen/CGVTables.h
  lib/CodeGen/CGVTT.cpp
  lib/CodeGen/CGVTables.cpp
  test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
  test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
  test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
  test/CodeGenCXX/microsoft-abi-structors.cpp
  test/CodeGenCXX/virtual-base-destructor-call.cpp
  test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
  test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
  include/clang/AST/VTableBuilder.h
  include/clang/AST/Mangle.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1532.1.patch
Type: text/x-patch
Size: 61440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130827/a1b14845/attachment.bin>


More information about the cfe-commits mailing list