summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-26 19:45:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-26 19:45:00 +0000
commit12f3ca4cdb95b193af905a00e722a4dcb40b3de3 (patch)
treeae1a7fcfc24a8d4b23206c57121c3f361d4b7f84 /lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
parentd99dafe2e4a385dd2a6c76da6d8258deb100657b (diff)
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFDebugLoc.cpp')
-rw-r--r--lib/DebugInfo/DWARF/DWARFDebugLoc.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
index e2799ab2d243d..d5c34216ed53e 100644
--- a/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
+++ b/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/StringRef.h"
+#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
#include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
#include "llvm/Support/Dwarf.h"
@@ -48,18 +49,10 @@ void DWARFDebugLoc::parse(DataExtractor data, unsigned AddressSize) {
// 2.6.2 Location Lists
// A location list entry consists of:
while (true) {
+ // A beginning and ending address offsets.
Entry E;
- RelocAddrMap::const_iterator AI = RelocMap.find(Offset);
- // 1. A beginning address offset. ...
- E.Begin = data.getUnsigned(&Offset, AddressSize);
- if (AI != RelocMap.end())
- E.Begin += AI->second.second;
-
- AI = RelocMap.find(Offset);
- // 2. An ending address offset. ...
- E.End = data.getUnsigned(&Offset, AddressSize);
- if (AI != RelocMap.end())
- E.End += AI->second.second;
+ E.Begin = getRelocatedValue(data, AddressSize, &Offset, &RelocMap);
+ E.End = getRelocatedValue(data, AddressSize, &Offset, &RelocMap);
// The end of any given location list is marked by an end of list entry,
// which consists of a 0 for the beginning address offset and a 0 for the