This commit adds functionality to the Apple Accelerator table allowing iteration
over all elements in the table.
Our iterators look like streaming iterators: when we increment the iterator we
check if there is still enough data in the "stream" (in our case, the blob of
data of the accelerator table) and extract the next entry. If any failures
occur, we immediately set the iterator to be the end iterator.
Since the ultimate user of this functionality is LLDB, there are roughly two
iteration methods we want support: one that also loads the name of each entry,
and one which does not. Loading names is measurably slower (one order the
magnitude) than only loading DIEs, so we used some template metaprograming to
implement both iteration methods.
Ah, sorry, I probably wouldn't complicate this by deriving, needing a virtual dtor, etc.
Maybe composition? EntryWithName could be closer to the std::pair (but, yeah, it needs to be a bit smarter) than this - contains an Entry, the offset and a function to get the name.