[PATCH] Emit the DIType for ObjC 'id<protocol>' as 'id' rather than objc_object* (fixes rdar://problem/12601916)
jahanian
fjahanian at apple.com
Thu Feb 21 10:07:43 PST 2013
+ // The frontend treats 'id' as a typedef to an ObjCObjectType,
+ // whereas 'id<protocol>' is treated as an ObjCPointerType. For the
+ // debug info, we want to emit 'id' in both cases.
+ QualType PointeeType = Ty->getPointeeType();
+ if (const ObjCObjectType *Obj = dyn_cast<ObjCObjectType>(PointeeType))
+ if (Obj->isObjCId() && (Obj->getNumProtocols() > 0)) {
+ return getOrCreateType(CGM.getContext().getObjCIdType(), Unit);
+ }
Please use isObjCQualifiedIdType instead.
- Fariborz
On Feb 20, 2013, at 3:20 PM, Adrian Prantl <aprantl at apple.com> wrote:
> Hi CFEes,
>
> please review the following patch:
>
> Emit the DIType for ObjC 'id<protocol>' as 'id' rather than objc_object*
> Fix for rdar://problem/12601916.
>
> The frontend treats 'id' as a typedef to an ObjCObjectType,
> whereas 'id<protocol>' is treated as an ObjCPointerType. For the
> debug info, we want to emit 'id' in both cases.
>
> cheers,
> Adrian
>
> <id-protocol-as-id.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130221/8a0f12b3/attachment.html>
More information about the cfe-commits
mailing list