]> granicus.if.org Git - llvm/commitdiff
Delete dead code.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 17:18:31 +0000 (17:18 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 17:18:31 +0000 (17:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285940 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELF.h

index 07f16112938dc47df6ae0304de18e2cc3d996ad3..2155fea5d2678fc2b69734decb35f4ff3ed3c3e1 100644 (file)
@@ -132,18 +132,11 @@ public:
   }
 
   /// \brief Iterate over program header table.
-  const Elf_Phdr *program_header_begin() const {
+  const Elf_Phdr_Range program_headers() const {
     if (Header->e_phnum && Header->e_phentsize != sizeof(Elf_Phdr))
       report_fatal_error("Invalid program header size");
-    return reinterpret_cast<const Elf_Phdr *>(base() + Header->e_phoff);
-  }
-
-  const Elf_Phdr *program_header_end() const {
-    return program_header_begin() + Header->e_phnum;
-  }
-
-  const Elf_Phdr_Range program_headers() const {
-    return makeArrayRef(program_header_begin(), program_header_end());
+    auto *Begin = reinterpret_cast<const Elf_Phdr *>(base() + Header->e_phoff);
+    return makeArrayRef(Begin, Begin+Header->e_phnum);
   }
 
   ErrorOr<StringRef> getSectionStringTable(Elf_Shdr_Range Sections) const;