[RFC] Safer Whole Program Class Hierarchy Analysis

I was thinking of this in March 2022 but then Teresa that the -fno-rtti limitation made it not useful to us (Google C++ Style Guide discourages RTTI)

Copying my reply from the patch:

I looked at this more closely after this patch was mailed. While use of RTTI is discouraged, building with -fno-rtti isn’t specifically encouraged afaict, and when I built a large number of important binaries internally with this patch in validation mode, it turned out that there were only a few objects/symbols affected, and we could allowlist them to enable WPD. See my earlier comment on the patch from July 25:

I cranked through a bunch of builds with this change and thankfully while they all do have at least one vtable from an -fno-rtti native object, there are only a handful of unique symbols (which all appear safe), so we could consider using --lto-known-safe-vtables to allowlist them.