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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 20 15:58:00 PDT 2018


Author: ruiu
Date: Thu Sep 20 15:58:00 2018
New Revision: 342695

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

Non-member functions are generally preferred over member functions
because it is clear that non-member functions don't depend on an
internal state of an object.

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=342695&r1=342694&r2=342695&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Sep 20 15:58:00 2018
@@ -77,7 +77,6 @@ private:
   void addRelIpltSymbols();
   void addStartEndSymbols();
   void addStartStopSymbols(OutputSection *Sec);
-  uint64_t getEntryAddr();
 
   std::vector<PhdrEntry *> Phdrs;
 
@@ -2206,7 +2205,7 @@ template <class ELFT> void Writer<ELFT>:
 // 4. the number represented by the entry symbol, if it is a number;
 // 5. the address of the first byte of the .text section, if present;
 // 6. the address 0.
-template <class ELFT> uint64_t Writer<ELFT>::getEntryAddr() {
+static uint64_t getEntryAddr() {
   // Case 1, 2 or 3
   if (Symbol *B = Symtab->find(Config->Entry))
     return B->getVA();




More information about the llvm-commits mailing list