diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-02-27 20:29:45 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-02-27 20:29:45 +0000 |
| commit | 40c589048eff307c370433e9abf5a2cb51810202 (patch) | |
| tree | 75363f6c56b904250d38fb60aba8ee1606944a4d /lld/ELF/ICF.cpp | |
| parent | ebcce78f65b0048b86c97a879d5f8ea13f528984 (diff) | |
| download | bcm5719-llvm-40c589048eff307c370433e9abf5a2cb51810202.tar.gz bcm5719-llvm-40c589048eff307c370433e9abf5a2cb51810202.zip | |
ELF: Remove relSize function from ICF.cpp. NFC.
llvm-svn: 262155
Diffstat (limited to 'lld/ELF/ICF.cpp')
| -rw-r--r-- | lld/ELF/ICF.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp index f41698e17a0..18d21108548 100644 --- a/lld/ELF/ICF.cpp +++ b/lld/ELF/ICF.cpp @@ -120,22 +120,14 @@ private: } } -// Returns a hash seed for relocation sections for S. -template <class ELFT> uint64_t ICF<ELFT>::relSize(InputSection<ELFT> *S) { - uint64_t Ret = 0; - for (const Elf_Shdr *H : S->RelocSections) - Ret += H->sh_size; - return Ret; -} - // Returns a hash value for S. Note that the information about // relocation targets is not included in the hash value. template <class ELFT> uint64_t ICF<ELFT>::getHash(InputSection<ELFT> *S) { uint64_t Flags = S->getSectionHdr()->sh_flags; uint64_t H = hash_combine(Flags, S->getSize()); - if (S->RelocSections.empty()) - return H; - return hash_combine(H, relSize(S)); + for (const Elf_Shdr *Rel : S->RelocSections) + H = hash_combine(H, (uint64_t)Rel->sh_size); + return H; } // Returns true if Sec is subject of ICF. |

