[lld] r255832 - ELF: Drop 'Sym' suffix from member function names for consistency.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 14:31:15 PST 2015


Author: ruiu
Date: Wed Dec 16 16:31:14 2015
New Revision: 255832

URL: http://llvm.org/viewvc/llvm-project?rev=255832&view=rev
Log:
ELF: Drop 'Sym' suffix from member function names for consistency.

Since the functions are members of SymbolTable class, it is obvious
that they are adding symbols.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/SymbolTable.cpp
    lld/trunk/ELF/SymbolTable.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=255832&r1=255831&r2=255832&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Dec 16 16:31:14 2015
@@ -260,7 +260,7 @@ template <class ELFT> void LinkerDriver:
     // an undefined symbol in the .o files.
     // Given that the symbol is effectively unused, we just create a dummy
     // hidden one to avoid the undefined symbol error.
-    Symtab.addIgnoredSym("_GLOBAL_OFFSET_TABLE_");
+    Symtab.addIgnored("_GLOBAL_OFFSET_TABLE_");
   }
 
   if (!Config->Entry.empty()) {
@@ -273,13 +273,13 @@ template <class ELFT> void LinkerDriver:
   if (Config->EMachine == EM_MIPS) {
     // On MIPS O32 ABI, _gp_disp is a magic symbol designates offset between
     // start of function and gp pointer into GOT.
-    Config->MipsGpDisp = Symtab.addIgnoredSym("_gp_disp");
+    Config->MipsGpDisp = Symtab.addIgnored("_gp_disp");
 
     // Define _gp for MIPS. st_value of _gp symbol will be updated by Writer
     // so that it points to an absolute address which is relative to GOT.
     // See "Global Data Symbols" in Chapter 6 in the following document:
     // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
-    Symtab.addAbsoluteSym("_gp", DefinedAbsolute<ELFT>::MipsGp);
+    Symtab.addAbsolute("_gp", DefinedAbsolute<ELFT>::MipsGp);
   }
 
   for (std::unique_ptr<InputFile> &F : Files)

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=255832&r1=255831&r2=255832&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Dec 16 16:31:14 2015
@@ -71,15 +71,15 @@ SymbolBody *SymbolTable<ELFT>::addUndefi
 }
 
 template <class ELFT>
-void SymbolTable<ELFT>::addAbsoluteSym(StringRef Name,
-                                       typename ELFFile<ELFT>::Elf_Sym &ESym) {
+void SymbolTable<ELFT>::addAbsolute(StringRef Name,
+                                    typename ELFFile<ELFT>::Elf_Sym &ESym) {
   resolve(new (Alloc) DefinedAbsolute<ELFT>(Name, ESym));
 }
 
 template <class ELFT>
-void SymbolTable<ELFT>::addSyntheticSym(StringRef Name,
-                                        OutputSectionBase<ELFT> &Section,
-                                        typename ELFFile<ELFT>::uintX_t Value) {
+void SymbolTable<ELFT>::addSynthetic(StringRef Name,
+                                     OutputSectionBase<ELFT> &Section,
+                                     typename ELFFile<ELFT>::uintX_t Value) {
   typedef typename DefinedSynthetic<ELFT>::Elf_Sym Elf_Sym;
   auto ESym = new (Alloc) Elf_Sym;
   memset(ESym, 0, sizeof(Elf_Sym));
@@ -89,7 +89,7 @@ void SymbolTable<ELFT>::addSyntheticSym(
 }
 
 template <class ELFT>
-SymbolBody *SymbolTable<ELFT>::addIgnoredSym(StringRef Name) {
+SymbolBody *SymbolTable<ELFT>::addIgnored(StringRef Name) {
   auto Sym = new (Alloc)
       DefinedAbsolute<ELFT>(Name, DefinedAbsolute<ELFT>::IgnoreUndef);
   resolve(Sym);

Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=255832&r1=255831&r2=255832&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Wed Dec 16 16:31:14 2015
@@ -50,11 +50,11 @@ public:
 
   SymbolBody *addUndefined(StringRef Name);
   SymbolBody *addUndefinedOpt(StringRef Name);
-  void addAbsoluteSym(StringRef Name,
-                      typename llvm::object::ELFFile<ELFT>::Elf_Sym &ESym);
-  void addSyntheticSym(StringRef Name, OutputSectionBase<ELFT> &Section,
-                       typename llvm::object::ELFFile<ELFT>::uintX_t Value);
-  SymbolBody *addIgnoredSym(StringRef Name);
+  void addAbsolute(StringRef Name,
+                   typename llvm::object::ELFFile<ELFT>::Elf_Sym &ESym);
+  void addSynthetic(StringRef Name, OutputSectionBase<ELFT> &Section,
+                    typename llvm::object::ELFFile<ELFT>::uintX_t Value);
+  SymbolBody *addIgnored(StringRef Name);
   bool isUndefined(StringRef Name);
   void scanShlibUndefined();
   SymbolBody *find(StringRef Name);

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=255832&r1=255831&r2=255832&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Dec 16 16:31:14 2015
@@ -640,11 +640,11 @@ template <class ELFT> void Writer<ELFT>:
   auto AddStartEnd = [&](StringRef Start, StringRef End,
                          OutputSectionBase<ELFT> *OS) {
     if (OS) {
-      Symtab.addSyntheticSym(Start, *OS, 0);
-      Symtab.addSyntheticSym(End, *OS, OS->getSize());
+      Symtab.addSynthetic(Start, *OS, 0);
+      Symtab.addSynthetic(End, *OS, OS->getSize());
     } else {
-      Symtab.addIgnoredSym(Start);
-      Symtab.addIgnoredSym(End);
+      Symtab.addIgnored(Start);
+      Symtab.addIgnored(End);
     }
   };
 
@@ -663,7 +663,7 @@ template <class ELFT> void Writer<ELFT>:
   // __tls_get_addr, so it's not defined anywhere. Create a hidden definition
   // to avoid the undefined symbol error.
   if (!isOutputDynamic())
-    Symtab.addIgnoredSym("__tls_get_addr");
+    Symtab.addIgnored("__tls_get_addr");
 
   // If the "_end" symbol is referenced, it is expected to point to the address
   // right after the data segment. Usually, this symbol points to the end
@@ -673,14 +673,14 @@ template <class ELFT> void Writer<ELFT>:
   // So, if this symbol is referenced, we just add the placeholder here
   // and update its value later.
   if (Symtab.find("_end"))
-    Symtab.addAbsoluteSym("_end", DefinedAbsolute<ELFT>::End);
+    Symtab.addAbsolute("_end", DefinedAbsolute<ELFT>::End);
 
   // If there is an undefined symbol "end", we should initialize it
   // with the same value as "_end". In any other case it should stay intact,
   // because it is an allowable name for a user symbol.
   if (SymbolBody *B = Symtab.find("end"))
     if (B->isUndefined())
-      Symtab.addAbsoluteSym("end", DefinedAbsolute<ELFT>::End);
+      Symtab.addAbsolute("end", DefinedAbsolute<ELFT>::End);
 
   // Scan relocations. This must be done after every symbol is declared so that
   // we can correctly decide if a dynamic relocation is needed.
@@ -819,9 +819,9 @@ void Writer<ELFT>::addStartStopSymbols(O
   StringRef Start = Saver.save("__start_" + S);
   StringRef Stop = Saver.save("__stop_" + S);
   if (Symtab.isUndefined(Start))
-    Symtab.addSyntheticSym(Start, *Sec, 0);
+    Symtab.addSynthetic(Start, *Sec, 0);
   if (Symtab.isUndefined(Stop))
-    Symtab.addSyntheticSym(Stop, *Sec, Sec->getSize());
+    Symtab.addSynthetic(Stop, *Sec, Sec->getSize());
 }
 
 template <class ELFT> static bool needsPhdr(OutputSectionBase<ELFT> *Sec) {




More information about the llvm-commits mailing list