<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 18, 2008, at 10:52 AM, Emerson Murphy-Hill wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ahoy!<div><br></div><div>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:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    <span style="color: #3f6e74">clang</span>::<span style="color: #5c2699">ObjCIvarDecl</span>* iVar = ... //your ivar here...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    <span style="color: #3f6e74">clang</span>::<span style="color: #3f6e74">Type</span>* t = iVar-><span style="color: #2e0d6e">getType</span>().<span style="color: #2e0d6e">getTypePtr</span>();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(46, 13, 110); "><span style="color: #000000">    t-></span>isObjCInterfaceType<span style="color: #000000">();</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div>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.</div><div><br></div></div></div></blockquote>What does <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">iVar-><span style="color: rgb(46, 13, 110); ">getType</span>().dump()  print?</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">Does 'iVar-><span style="color: rgb(46, 13, 110); ">getType</span>()<span class="Apple-style-span" style="color: rgb(46, 13, 110); "><span style="color: rgb(0, 0, 0); ">-></span>isObjCInterfaceType<span style="color: rgb(0, 0, 0); ">()' work?</span></span></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">-Chris</span></font></div></body></html>