[PATCH] D102374: [clang][Fuchsia] Turn on relative-vtables by default for Fuchsia

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 13 11:09:57 PDT 2021


leonardchan added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:3293
+static bool SupportsRelativeCXXVTables(const llvm::Triple &T) {
+  return T.isOSFuchsia();
+}
----------------
phosek wrote:
> Could we instead enable it inside `FuchsiaCXXABI`?
So we can't necessarily turn this on in just FuchsiaCXXABI/CodeGen because many of the vtable offsets and components are constructed in the AST stage which is later consumed by codegen and the CXXABI classes to make the vtables. More specifically, it's the `ItaniumVTableContext` created in `ASTContext::getVTableContext()` in charge of calculating these offsets.

I put it here because controlling the flag seems like the easiest way to set a default value given the target, and it's available either during or before the AST stage.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102374/new/

https://reviews.llvm.org/D102374



More information about the cfe-commits mailing list