This is a preparatory commit for D68465. That commit introduces location
list range trimming for values that are call-clobbered, in order to
improve compatibility with GDB. If a variable is described by a mix of
values that are call-clobbered and those that are not, then we need to
be able to start a location list entry inside the call instruction for
all values that are not call-clobbered. This commit adds support for
inserting such expressions in the address pool.
My initial thought was to allow MCExprs in the address pool, but I gave
up on that idea when I did not find a good way to unique them, and went
with simple <Symbol, Offset> pairs instead, as I did not foresee the
need for more advanced expressions.
D68465 only adds tests for cases where the offset is negative. I'm not
sure how to test cases where the offset is positive. Should that be
covered by an assert instead?
I usually recommend defining a struct instead, so the members can have descriptive names for better readability. Since you still want the DenseMap to work, a trick I used elsewhere is to inherit from std::pair and provide accessors. Maybe that's excessive here.