[cfe-dev] Type>>isObjCInterfaceType() blows up

Chris Lattner clattner at apple.com
Fri Apr 18 10:55:51 PDT 2008


On Apr 18, 2008, at 10:52 AM, Emerson Murphy-Hill wrote:

> Ahoy!
>
> I'm trying to determine the SourceLocation of an Objective-C  
> instance variable's type, if there is one.  This seemed like a  
> reasonable way to start:
>
>     clang::ObjCIvarDecl* iVar = ... //your ivar here...
>     clang::Type* t = iVar->getType().getTypePtr();
>     t->isObjCInterfaceType();
>
> Unfortunately, I get an EXC_BAD_ACCESS on the final line.  For the  
> test case I'm working on, I would have expected it to simply return  
> false, since my ivar is an int.
>
What does iVar->getType().dump()  print?

Does 'iVar->getType()->isObjCInterfaceType()' work?

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080418/de08f5f5/attachment.html>


More information about the cfe-dev mailing list