[llvm] r355892 - llvm-objcopy: Remove unused field. NFCI.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 19:17:01 PDT 2019
Author: pcc
Date: Mon Mar 11 19:17:01 2019
New Revision: 355892
URL: http://llvm.org/viewvc/llvm-project?rev=355892&view=rev
Log:
llvm-objcopy: Remove unused field. NFCI.
Differential Revision: https://reviews.llvm.org/D59126
Modified:
llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
llvm/trunk/tools/llvm-objcopy/ELF/Object.h
Modified: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp?rev=355892&r1=355891&r2=355892&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp Mon Mar 11 19:17:01 2019
@@ -901,9 +901,7 @@ template <class ELFT> void ELFBuilder<EL
template <class ELFT> void ELFBuilder<ELFT>::readProgramHeaders() {
uint32_t Index = 0;
for (const auto &Phdr : unwrapOrError(ElfFile.program_headers())) {
- ArrayRef<uint8_t> Data{ElfFile.base() + Phdr.p_offset,
- (size_t)Phdr.p_filesz};
- Segment &Seg = Obj.addSegment(Data);
+ Segment &Seg = Obj.addSegment();
Seg.Type = Phdr.p_type;
Seg.Flags = Phdr.p_flags;
Seg.OriginalOffset = Phdr.p_offset;
Modified: llvm/trunk/tools/llvm-objcopy/ELF/Object.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ELF/Object.h?rev=355892&r1=355891&r2=355892&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.h (original)
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.h Mon Mar 11 19:17:01 2019
@@ -312,10 +312,6 @@ public:
uint32_t Index;
uint64_t OriginalOffset;
Segment *ParentSegment = nullptr;
- ArrayRef<uint8_t> Contents;
-
- explicit Segment(ArrayRef<uint8_t> Data) : Contents(Data) {}
- Segment() {}
const SectionBase *firstSection() const {
if (!Sections.empty())
@@ -827,8 +823,8 @@ public:
Ptr->Index = Sections.size();
return *Ptr;
}
- Segment &addSegment(ArrayRef<uint8_t> Data) {
- Segments.emplace_back(llvm::make_unique<Segment>(Data));
+ Segment &addSegment() {
+ Segments.emplace_back(llvm::make_unique<Segment>());
return *Segments.back();
}
};
More information about the llvm-commits
mailing list