DebugInfo: Introduce DebugLocList to encapsulate a list of DebugLocEntries and an MC Label to refer to them

This removes the magic-number-esque code creating/retrieving the same
label for a debug_loc entry from two places and removes the last small
piece of reusable logic from emitDebugLoc so that there will be less
duplication when refactoring it into two functions (one for debug_loc,
the other for debug_loc.dwo).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-04-02 01:43:18 +00:00
parent 91b97ccd87
commit b2d73d1556
5 changed files with 39 additions and 12 deletions

View File

@ -284,9 +284,10 @@ void DIEHash::hashBlockData(const SmallVectorImpl<DIEValue *> &Values) {
// Hash the contents of a loclistptr class.
void DIEHash::hashLocList(const DIELocList &LocList) {
HashingByteStreamer Streamer(*this);
DwarfDebug &DD = *AP->getDwarfDebug();
for (const auto &Entry :
AP->getDwarfDebug()->getDebugLocEntries()[LocList.getValue()])
AP->getDwarfDebug()->emitDebugLocEntry(Streamer, Entry);
DD.getDebugLocEntries()[LocList.getValue()].List)
DD.emitDebugLocEntry(Streamer, Entry);
}
// Hash an individual attribute \param Attr based on the type of attribute and