mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-04 06:51:56 +00:00
Don't use getNumSections.
It is just the size of sections() which we were already calling. llvm-svn: 285811
This commit is contained in:
parent
6b42a5b0fd
commit
235d82cd0a
@ -286,12 +286,13 @@ bool elf::ObjectFile<ELFT>::shouldMerge(const Elf_Shdr &Sec) {
|
|||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
void elf::ObjectFile<ELFT>::initializeSections(
|
void elf::ObjectFile<ELFT>::initializeSections(
|
||||||
DenseSet<CachedHashStringRef> &ComdatGroups) {
|
DenseSet<CachedHashStringRef> &ComdatGroups) {
|
||||||
uint64_t Size = this->ELFObj.getNumSections();
|
const ELFFile<ELFT> &Obj = this->ELFObj;
|
||||||
|
ArrayRef<Elf_Shdr> ObjSections = check(Obj.sections());
|
||||||
|
uint64_t Size = ObjSections.size();
|
||||||
Sections.resize(Size);
|
Sections.resize(Size);
|
||||||
unsigned I = -1;
|
unsigned I = -1;
|
||||||
const ELFFile<ELFT> &Obj = this->ELFObj;
|
|
||||||
StringRef SectionStringTable = check(Obj.getSectionStringTable());
|
StringRef SectionStringTable = check(Obj.getSectionStringTable());
|
||||||
for (const Elf_Shdr &Sec : check(Obj.sections())) {
|
for (const Elf_Shdr &Sec : ObjSections) {
|
||||||
++I;
|
++I;
|
||||||
if (Sections[I] == &InputSection<ELFT>::Discarded)
|
if (Sections[I] == &InputSection<ELFT>::Discarded)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user