[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 11:42:17 PST 2013
If Eric is OK with debug info. issues, go ahead check it in.
- Fariborz
On Feb 21, 2013, at 10:50 AM, Adrian Prantl <aprantl at apple.com> wrote:
>
> 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
>
> <0001-Emit-the-DIType-for-ObjC-id-protocol-as-id-rather-th.patch>
>
More information about the cfe-commits
mailing list