[PATCH] CodeGen: Refactor RTTI emission
Reid Kleckner
rnk at google.com
Mon Jun 23 15:52:40 PDT 2014
lgtm
================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:1950
@@ +1949,3 @@
+
+namespace {
+class ItaniumRTTIBuilder {
----------------
David Majnemer wrote:
> Reid Kleckner wrote:
> > Looks like the Itanium code paths weigh in at ~900 lines and the MS ones at ~500. That's kind of my internal threshold for "this deserves it's own file". IIRC you considered but rejected ItaniumRTTI.cpp. Why? I don't see any problem with a lib/CodeGen/ItaniumRTTI.h that exposes some free functions that ItaniumCXXABI calls to.
> As an example:
> `ItaniumCXXABI::getAddrOfRTTIDescriptor` refers to `ItaniumRTTIBuilder`. Either we somehow expose a `CXXABIRTTIBuilder` base class for both of them (as well as factory functions to create them) or we just merge them into their respective ABI implementations.
>
> I can do either but it made more sense, to me, to avoid creating another interface.
OK, sgtm. We don't want a base class. The interface won't be the same. In Itanium, the type info object has all the relevant data, whereas in MS the other data points to the type_info struct.
http://reviews.llvm.org/D4261
More information about the cfe-commits
mailing list