The 4 patches are:
- Fix DWARFContext::getCompileUnitForOffset()
The comparator used for the search compares the beginning of the CU Offset, but this will return CUs.end() when the searched offset is in the last CU. Use the Unit end offset instead in the comparator. This requires some cleverness so that searching for a start offset will return the good unit.
lib/DebugInfo/DWARFContext.cpp | 37 +++++++++++++++++++++---------------- - Make DWARFContext::getCompileUnitForOffset() public.
They will be used by DIE dump() to resolve reference attributes.
lib/DebugInfo/DWARFContext.h | 2 +- - Handle cross-unit references in DWARFDebugInfoEntryMinimal::getSubroutineName().
lib/DebugInfo/DWARFDebugInfoEntry.cpp | 7 +++++++ - [dwarfdump] Print the name for referenced specification of abstract_origin DIEs.
This way, when you have a inlined/template instance in the debug information, it's easy to find out wihtout searching what the instance origin.
lib/DebugInfo/DWARFDebugInfoEntry.cpp | 14 ++++++++++++++ test/Linker/type-unique-odr-a.ll | 2 +-
I have a sneaking suspicion that <= ordering would violate the requirements of lower_bound...
I /suspect/ the right answer is:
Off < RHS->getOffset()
LHS->getNextUnitOffset() <= Off
LHS->getNextUnitOffset() <= RHS->getOffset()
That should be a proper "less than" for a half open range [offset, next unit offset), I think... maybe?