[PATCH] D52674: [AST] Add Obj-C discriminator to MS ABI RTTI

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 17:48:42 PDT 2018


rjmccall added a comment.

In https://reviews.llvm.org/D52674#1251439, @smeenai wrote:

> In https://reviews.llvm.org/D52674#1251419, @rjmccall wrote:
>
> > Conceptually this seems fine, but I think it would be good to stop and make sure we're using a consistent style when mangling extensions.  Currently it feels like every patch to add a Clang extension to the Microsoft mangling ends up inventing its own rules and crossing its fingers.
>
>
> That's a fair concern.
>
> I believe most of the Obj-C extensions have been handled by @compnerd, and he's been following a pretty consistent scheme using the `__Objc` namespace, e.g. `void f(id<P>) {}` is mangled as `void __cdecl f(struct objc_object<struct __ObjC::Protocol<struct P> > *)`. I could certainly try to implement something similar here, except as I mentioned, I'm pretty sure it would require maintaining some state in the demangler for indicating whether we were mangling for RTTI.


State wouldn't really be the right solution anyway, although it might work because of the structural restrictions on Objective-C types.  If you wanted to keep that same rule, I think you could probably just pass a (default=`false`) flag down to the `ObjCObjectPointerType`, `ObjCObjectType`, and `ObjCInterfaceType` cases.  (The pointee type of the former will always be one of the latter two.)


Repository:
  rC Clang

https://reviews.llvm.org/D52674





More information about the cfe-commits mailing list