More documentation is always good, but I for one have no idea what's going on in that image, and I like to think that I mostly understand SourceLocation :-)
That's very useful feedback!
It definitely needs some work, and some text.
But maybe it's just the wrong model.
The idea is that SourceLocation is just a (FileID, offset) pair, and everyone knows how files and offsets work. So the difficult part is understanding the real and "virtual" files (SLocEntry) and how they relate to each other.
The nodes in the diagram are the SLocEntrys in an example program (the main.cpp file).
The text contents are shown, this is what a (FileID, offset) pair indexes into. (For expansions, this is the spelling).
The black edges are (immediate) expansion location. This forms the logical macro expression tree that everyone is familiar with. Partial traversal can be useful/meaningful.
Labels show what expression in the parent is being substituted.
Yellow edges show (immediate) spelling location. As far as I can tell, these are mainly useful a) to get the content of expansion SLocEntrys which don't have buffers and b) to produce diagnostics that reference actual source code. But partial traversal here doesn't seem to be useful.
(black edges are expansion, yellow edges are source)
Did I miss some documentation of this concept?
Would it be worth writing up an article illustrated with some examples, to add to llvm.org? Maybe this is niche or well-understood, interested in what others think.