[PATCH] Emit the DIType for ObjC 'id<protocol>' as 'id' rather than objc_object* (fixes rdar://problem/12601916)

Adrian Prantl aprantl at apple.com
Thu Feb 21 10:50:45 PST 2013


On Feb 21, 2013, at 10:07 AM, jahanian <fjahanian at apple.com> wrote:

> +  // 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.
> 

That makes the patch even simpler!

thanks,
adrian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Emit-the-DIType-for-ObjC-id-protocol-as-id-rather-th.patch
Type: application/octet-stream
Size: 3974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130221/ad926dd9/attachment.obj>
-------------- next part --------------




More information about the cfe-commits mailing list