summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ICF.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-04-26 23:52:44 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-04-26 23:52:44 +0000
commit676c7cd1ed0fa54f65ab5fade1b4b8b61a2968d1 (patch)
treee119b018995598568ee0b3a7d893d3a7be4f6f01 /lld/ELF/ICF.cpp
parentd9974cc9131e8f3a342b4b12941a9cb7cb7228b0 (diff)
downloadbcm5719-llvm-676c7cd1ed0fa54f65ab5fade1b4b8b61a2968d1.tar.gz
bcm5719-llvm-676c7cd1ed0fa54f65ab5fade1b4b8b61a2968d1.zip
ELF: Move code to where it is used, and related cleanups. NFC.
Differential Revision: http://reviews.llvm.org/D19490 llvm-svn: 267637
Diffstat (limited to 'lld/ELF/ICF.cpp')
-rw-r--r--lld/ELF/ICF.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 0f23e640cfc..acb36fa6da3 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -93,8 +93,6 @@ private:
static uint64_t getHash(InputSection<ELFT> *S);
static bool isEligible(InputSectionBase<ELFT> *Sec);
static std::vector<InputSection<ELFT> *> getSections(SymbolTable<ELFT> *S);
- static SymbolBody &getSymbol(const InputSection<ELFT> *Sec,
- const Elf_Rel *Rel);
void segregate(InputSection<ELFT> **Begin, InputSection<ELFT> **End,
Comparator Eq);
@@ -158,13 +156,6 @@ ICF<ELFT>::getSections(SymbolTable<ELFT> *Symtab) {
return V;
}
-template <class ELFT>
-SymbolBody &ICF<ELFT>::getSymbol(const InputSection<ELFT> *Sec,
- const Elf_Rel *Rel) {
- uint32_t SymIdx = Rel->getSymbol(Config->Mips64EL);
- return Sec->File->getSymbolBody(SymIdx);
-}
-
// All sections between Begin and End must have the same group ID before
// you call this function. This function compare sections between Begin
// and End using Eq and assign new group IDs for new groups.
@@ -255,8 +246,8 @@ bool ICF<ELFT>::variableEq(const InputSection<ELFT> *A,
const RelTy *EA = RelsA.end();
const RelTy *IB = RelsB.begin();
for (; IA != EA; ++IA, ++IB) {
- SymbolBody &SA = getSymbol(A, (const Elf_Rel *)IA);
- SymbolBody &SB = getSymbol(B, (const Elf_Rel *)IB);
+ SymbolBody &SA = A->File->getRelocTargetSym(*IA);
+ SymbolBody &SB = B->File->getRelocTargetSym(*IB);
if (&SA == &SB)
continue;
OpenPOWER on IntegriCloud