[lld] r347678 - Make a member function non-member. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 09:47:24 PST 2018


Author: ruiu
Date: Tue Nov 27 09:47:24 2018
New Revision: 347678

URL: http://llvm.org/viewvc/llvm-project?rev=347678&view=rev
Log:
Make a member function non-member. NFC.

Modified:
    lld/trunk/ELF/ICF.cpp

Modified: lld/trunk/ELF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ICF.cpp?rev=347678&r1=347677&r2=347678&view=diff
==============================================================================
--- lld/trunk/ELF/ICF.cpp (original)
+++ lld/trunk/ELF/ICF.cpp Tue Nov 27 09:47:24 2018
@@ -119,9 +119,6 @@ private:
 
   void forEachClass(llvm::function_ref<void(size_t, size_t)> Fn);
 
-  template <class RelTy>
-  void combineRelocHashes(InputSection *IS, ArrayRef<RelTy> Rels);
-
   std::vector<InputSection *> Sections;
 
   // We repeat the main loop while `Repeat` is true.
@@ -428,9 +425,8 @@ void ICF<ELFT>::forEachClass(llvm::funct
 
 // Combine the hashes of the sections referenced by the given section into its
 // hash.
-template <class ELFT>
-template <class RelTy>
-void ICF<ELFT>::combineRelocHashes(InputSection *IS, ArrayRef<RelTy> Rels) {
+template <class ELFT, class RelTy>
+static void combineRelocHashes(InputSection *IS, ArrayRef<RelTy> Rels) {
   uint32_t Hash = IS->Class[1];
   for (RelTy Rel : Rels) {
     Symbol &S = IS->template getFile<ELFT>()->getRelocTargetSym(Rel);
@@ -462,9 +458,9 @@ template <class ELFT> void ICF<ELFT>::ru
 
   parallelForEach(Sections, [&](InputSection *S) {
     if (S->AreRelocsRela)
-      combineRelocHashes(S, S->template relas<ELFT>());
+      combineRelocHashes<ELFT>(S, S->template relas<ELFT>());
     else
-      combineRelocHashes(S, S->template rels<ELFT>());
+      combineRelocHashes<ELFT>(S, S->template rels<ELFT>());
   });
 
   // From now on, sections in Sections vector are ordered so that sections




More information about the llvm-commits mailing list