[PATCH] D59126: llvm-objcopy: Remove unused field. NFCI.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 19:17:09 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355892: llvm-objcopy: Remove unused field. NFCI. (authored by pcc, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D59126?vs=189814&id=190199#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59126/new/
https://reviews.llvm.org/D59126
Files:
llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
llvm/trunk/tools/llvm-objcopy/ELF/Object.h
Index: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
===================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
@@ -901,9 +901,7 @@
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;
Index: llvm/trunk/tools/llvm-objcopy/ELF/Object.h
===================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.h
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.h
@@ -312,10 +312,6 @@
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 @@
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();
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59126.190199.patch
Type: text/x-patch
Size: 1512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190312/773b4b83/attachment.bin>
More information about the llvm-commits
mailing list