[PATCH] D152405: [WIP][clang] Add experimental option to omit the RTTI component from the vtable when -fno-rtti is used

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 16:56:21 PDT 2023


leonardchan added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:2250
+def fexperimental_omit_rtti_component :
+  Flag<["-"], "fexperimental-omit-rtti-component">,
+  Group<f_clang_Group>, Flags<[CC1Option]>,
----------------
phosek wrote:
> I think the name should signal that this is related to vtables (otherwise users might be wondering what "component" is this referring to).
> 
> We could use `-fexperimental-omit-vtable-rtti-component` but that's quite a mouthful, maybe `-fexperimental-omit-vtable-rtti` would suffice?
> I think the name should signal that this is related to vtables (otherwise users might be wondering what "component" is this referring to).

Formally, this can be used independently of relative vtables. So under the regular itanium c++ abi this would reduce the vtable by a pointer size and under RV it would reduce the vtable by an offset size. "Component" I believe is the formal name for the actual elements in the vtable: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-components.

> We could use -fexperimental-omit-vtable-rtti-component but that's quite a mouthful, maybe -fexperimental-omit-vtable-rtti would suffice?

WFM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152405



More information about the cfe-commits mailing list