<div dir="ltr"><div>I never felt that I completely understood the code I wrote/reviewed in tools dealing with SourceLocation. And clangd has had several bugs that boil down to wrong locations in the presence of macros.</div><div><br></div><div>I couldn't find a good guide for how to think about them, so I spent a while reading the source code and wrote a tool to visualize them, which helped me a lot:</div><div>  <a href="https://imgur.com/f3cXp7E">https://imgur.com/f3cXp7E</a><br></div><div>(black edges are expansion, yellow edges are source)</div><div><br></div><div>Did I miss some documentation of this concept?</div><div>Would it be worth writing up an article illustrated with some examples, to add to <a href="http://llvm.org">llvm.org</a>? Maybe this is niche or well-understood, interested in what others think.</div></div>