mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-30 23:21:04 +00:00
502fd5ddfa
Requires callers to directly associate relocations with a DataExtractor used to read data from a DWARF section, which helps a callee not make assumptions about which section it is reading. This is the next step in reducing DWARFFormValue's dependence on DWARFUnit. Differential Revision: https://reviews.llvm.org/D34704 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306699 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
850 B
C++
25 lines
850 B
C++
//===- DWARFDataExtractor.cpp ---------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
|
|
|
|
using namespace llvm;
|
|
|
|
uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
|
|
uint64_t *SecNdx) const {
|
|
if (!RelocMap)
|
|
return getUnsigned(Off, Size);
|
|
RelocAddrMap::const_iterator AI = RelocMap->find(*Off);
|
|
if (AI == RelocMap->end())
|
|
return getUnsigned(Off, Size);
|
|
if (SecNdx)
|
|
*SecNdx = AI->second.SectionIndex;
|
|
return getUnsigned(Off, Size) + AI->second.Value;
|
|
}
|