[PATCH] D77592: [NFC}[CodeGen] Make VTable initialization a method of CGCXXABI

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 15:16:41 PDT 2020


leonardchan created this revision.
leonardchan added reviewers: pcc, rjmccall, rsmith.
leonardchan added a project: clang.

This patch moves the following instances of this snippet:

  ConstantInitBuilder builder(CGM);
  auto components = builder.beginStruct();
  CGVT.createVTableInitializer(components, VTLayout, RTTI);
  components.finishAndSetAsInitializer(VTable);

into CGCXXABI under a virtual method called `SetVTableInitializer`, which will be in charge of selecting the correct vtable initialization from `CodegenVTables`.

This is a prerequisite for landing the relative vtables ABI in Fuchsia (see D72959 <https://reviews.llvm.org/D72959>). The plan is to add a `createRelativeVTableInitializer()` method to `CodegenVTables` which will be a helper for making PIC-friendly vtables.

This does not affect any tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77592

Files:
  clang/lib/CodeGen/CGCXXABI.cpp
  clang/lib/CodeGen/CGCXXABI.h
  clang/lib/CodeGen/CGVTables.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/CodeGen/MicrosoftCXXABI.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77592.255502.patch
Type: text/x-patch
Size: 4589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200406/93c65179/attachment-0001.bin>


More information about the cfe-commits mailing list