Hi Akira,

Pardon my slowness in addressing your question.

> This patch changes the encoding of an id conforming to a protocol, which I 
> think was not intended: For example:
> 
> @encode(id<NSObject>)
> 
> Would passing IVD to the call to getObjCEncodingForType in 
> CGObjCGNU::GenerateClass solve the problem?

Are you suggesting that passing IVD instead of just IVD->getType() will tell 
getObjCEncodingForType whether the code being compiled is a protocol, as 
opposed to an object?  I'm a little confused here, because IVD is an object of 
type ObjCIvarDecl, which is supposed to represent an instance variable, not a 
protocol.  Also, I don't see anything in the definition of ObjCIvarDecl (in 
AST/DeclObjC.h) that would tell us whether it represents an instance variable 
or a protocol.  Can you explain the case you are concerned about a little more?

If IVD can in fact tell us whether the code being compiled is an object, then 
we can make the EncodeClassNames argument of getObjCEncodingForTypeImpl true 
for ivars and false for protocols.

Thanks!

--David
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to