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

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 15 13:43:38 PST 2018


smeenai planned changes to this revision.
smeenai added a comment.

In https://reviews.llvm.org/D52674#1298115, @rjmccall wrote:

> In https://reviews.llvm.org/D52674#1297893, @smeenai wrote:
>
> > In https://reviews.llvm.org/D52674#1297879, @rjmccall wrote:
> >
> > > I'm not worried about the mangler being re-used for multiple declarations, I'm worried about a global flag changing how we mangle all components of a type when we only mean to change it at the top level.
> >
> >
> > Hmm, but don't we want it to affect all components? For example, consider something like:
> >
> >   @interface I
> >   @end
> >  
> >   template <class T> class C {};
> >  
> >   void f();
> >   void g() {
> >     try {
> >       f();
> >     } catch (C<I> *) {
> >     }
> >   }
> >
> >
> > I would say that we want the RTTI for `C<I> *` to have the discriminator for `I`.
>
>
> Why?  IIUC, you're adding the discriminator to distinguish between two different RTTI objects.  It's not like there are two different types.  You should mangle `C<I>` normally here.


You're right – I wasn't thinking this through correctly. Back to the drawing board.


Repository:
  rC Clang

https://reviews.llvm.org/D52674





More information about the cfe-commits mailing list