[lld] r297290 - Rename one of the getOffset methods.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 8 07:57:17 PST 2017
Author: rafael
Date: Wed Mar 8 09:57:17 2017
New Revision: 297290
URL: http://llvm.org/viewvc/llvm-project?rev=297290&view=rev
Log:
Rename one of the getOffset methods.
It is sufficiently different in that it returns an offset in the input
file, not the output section.
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/InputSection.h
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=297290&r1=297289&r2=297290&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Mar 8 09:57:17 2017
@@ -107,7 +107,7 @@ std::string elf::ObjectFile<ELFT>::getLi
// section. See comments for ObjectInfo class.
DILineInfo Info;
Tbl->getFileLineInfoForAddress(
- S->getOffset() + Offset, nullptr,
+ S->getOffsetInFile() + Offset, nullptr,
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info);
if (Info.Line == 0)
return "";
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=297290&r1=297289&r2=297290&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Mar 8 09:57:17 2017
@@ -93,7 +93,7 @@ size_t InputSectionBase::getSize() const
return Data.size();
}
-uint64_t InputSectionBase::getOffset() const {
+uint64_t InputSectionBase::getOffsetInFile() const {
const uint8_t *FileStart = (const uint8_t *)File->MB.getBufferStart();
const uint8_t *SecStart = Data.begin();
return SecStart - FileStart;
Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=297290&r1=297289&r2=297290&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Wed Mar 8 09:57:17 2017
@@ -63,7 +63,7 @@ public:
uint32_t Link;
uint32_t Info;
- uint64_t getOffset() const;
+ uint64_t getOffsetInFile() const;
static InputSectionBase Discarded;
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=297290&r1=297289&r2=297290&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar 8 09:57:17 2017
@@ -1733,7 +1733,8 @@ static InputSectionBase *findSection(Arr
uint64_t Offset) {
for (InputSectionBase *S : Arr)
if (S && S != &InputSection::Discarded)
- if (Offset >= S->getOffset() && Offset < S->getOffset() + S->getSize())
+ if (Offset >= S->getOffsetInFile() &&
+ Offset < S->getOffsetInFile() + S->getSize())
return S;
return nullptr;
}
@@ -1752,8 +1753,8 @@ readAddressArea(DWARFContext &Dwarf, Inp
for (std::pair<uint64_t, uint64_t> &R : Ranges)
if (InputSectionBase *S = findSection<ELFT>(Sections, R.first))
- Ret.push_back({S, R.first - S->getOffset(), R.second - S->getOffset(),
- CurrentCU});
+ Ret.push_back({S, R.first - S->getOffsetInFile(),
+ R.second - S->getOffsetInFile(), CurrentCU});
++CurrentCU;
}
return Ret;
More information about the llvm-commits
mailing list