<div class="gmail_quote">On Fri Oct 31 2014 at 2:10:31 PM Christian Convey <<a href="mailto:christian.convey@gmail.com" target="_blank">christian.convey@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm dealing with the clang AST for the first time, and I'm having<br>
trouble understanding from the doxygen docs how the various flavors of<br>
source locations relate to each other.  Can anyone point me to a good<br>
explanation?<br>
<br>
I *think* I'm pretty clear on spelling locations.  But I'm definitely<br>
confused about "presumed location" and "getImmediateExpansionRange"<br></blockquote><div><br></div></div><div class="gmail_quote"><div>Yea, those are tricky - I wanted to write a tutorial there for a while, but never got around to it; I tried to cover some of that in my talk on the clang AST you can view at <a href="http://clang.llvm.org/docs/IntroductionToTheClangAST.html" target="_blank">http://clang.llvm.org/docs/IntroductionToTheClangAST.html</a> (although it doesn't cover presumed locations).</div><div><br></div><div>I also have a patch that rsmith has bikeshed to death (which means I've stopped working on it after a while, perhaps I should revive it) which enables you to get nice output about source locations like this:</div><div><a href="http://pastebin.com/SzjYDDiu">http://pastebin.com/SzjYDDiu</a><br></div><div><br></div><div>If you look at that it gives you a nice example on how expansion and spelling locations work, and why there are different levels. The "immediate" functions always go one level either towards the spelling or the expansion. Note how it is generally a tree and not a single chain.</div><div><br></div><div>Presumed locations are simply the expansion locations modified by the #line directives (which you for example find in preprocessed files).</div><div><br></div><div>Cheers,</div><div>/Manuel</div><div><br></div></div><div class="gmail_quote"><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
______________________________<u></u><u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/cfe-dev</a><br>
</blockquote></div>