1 //===- DWARFDataExtractor.cpp ---------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
11 
12 using namespace llvm;
13 
14 uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
15                                                uint64_t *SecNdx) const {
16   if (!RelocMap)
17     return getUnsigned(Off, Size);
18   RelocAddrMap::const_iterator AI = RelocMap->find(*Off);
19   if (AI == RelocMap->end())
20     return getUnsigned(Off, Size);
21   if (SecNdx)
22     *SecNdx = AI->second.SectionIndex;
23   return getUnsigned(Off, Size) + AI->second.Value;
24 }
25