[cfe-dev] clang::ObjCInterfaceTypeLoc

Alex L via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 13 17:23:16 PST 2017


Hi Vladimir,

It looks to me that this is a bug. However, it currently seems to works
because ObjCInterfaceLocInfo is initialized through ObjCObjectTypeLoc so
ObjCObjectTypeLocInfo is valid, and after that we initialize
ObjCInterfaceTypeLocInfo.
I guess that we don't really see the effect of the bug because we don't
have tests that check for conflict between the name location
from ObjCInterfaceTypeLocInfo and left angle/right angle locations
from ObjCObjectTypeLoc.
I think that it would make sense for ObjCInterfaceTypeLoc to derive
from ObjCObjectTypeLoc
directly. I'll try to clean it up.

Alex

On 12 February 2017 at 16:34, Vladimir Voskresensky via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello Clang experts,
>
> Could you help me, please, to understand how does ObjCInterfaceTypeLoc
> class suppose to work?
> ObjCInterfaceTypeLoc is the only one class in TypeLoc hierarchy which
> inherits twice from ConcreteTypeLoc.
> I see in source code and visually at
> http://ftp.llvm.org/doxygen/classclang_1_1ObjCInterfaceTypeLoc.html
>
> It is derived from ObjCObjectTypeLoc (which uses ObjCObjectTypeLocInfo),
> but has own ObjCInterfaceLocInfo (passed as LocalData).
> Does it replace the ObjCObjectTypeLocInfo used by ObjCObjectTypeLoc?
> ObjCInterfaceLocInfo is not derived from ObjCObjectTypeLocInfo, so
> sizeof(ObjCInterfaceLocInfo) < sizeof(ObjCObjectTypeLocInfo)
> How methods of ObjCObjectTypeLoc can work for ObjCInterfaceTypeLoc
> instance?
> Shouldn't it be more like:
> http://clang.llvm.org/doxygen/classclang_1_1TypeofLikeTypeLoc.html
>
>
> Thanks!
> Vladimir.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170213/b6bb5f07/attachment.html>


More information about the cfe-dev mailing list