[lld] r256195 - Remove simple uses of Base::.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 12:47:33 PST 2015


Author: rafael
Date: Mon Dec 21 14:47:33 2015
New Revision: 256195

URL: http://llvm.org/viewvc/llvm-project?rev=256195&view=rev
Log:
Remove simple uses of Base::.

They have a tendency to get out of date and obscure where the value/type
is from.

Modified:
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=256195&r1=256194&r2=256195&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Mon Dec 21 14:47:33 2015
@@ -156,7 +156,7 @@ template <class ELFT> class Defined : pu
   typedef ELFSymbolBody<ELFT> Base;
 
 protected:
-  typedef typename Base::Kind Kind;
+  typedef typename SymbolBody::Kind Kind;
   typedef typename Base::Elf_Sym Elf_Sym;
 
 public:
@@ -189,10 +189,10 @@ public:
   static Elf_Sym RelaIpltEnd;
 
   DefinedAbsolute(StringRef N, const Elf_Sym &Sym)
-      : Defined<ELFT>(Base::DefinedAbsoluteKind, N, Sym) {}
+      : Defined<ELFT>(SymbolBody::DefinedAbsoluteKind, N, Sym) {}
 
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::DefinedAbsoluteKind;
+    return S->kind() == SymbolBody::DefinedAbsoluteKind;
   }
 };
 
@@ -218,12 +218,12 @@ template <class ELFT> class DefinedCommo
 public:
   typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
   DefinedCommon(StringRef N, const Elf_Sym &Sym)
-      : Defined<ELFT>(Base::DefinedCommonKind, N, Sym) {
+      : Defined<ELFT>(SymbolBody::DefinedCommonKind, N, Sym) {
     MaxAlignment = Sym.st_value;
   }
 
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::DefinedCommonKind;
+    return S->kind() == SymbolBody::DefinedCommonKind;
   }
 
   // The output offset of this common symbol in the output bss. Computed by the
@@ -242,10 +242,11 @@ template <class ELFT> class DefinedRegul
 public:
   DefinedRegular(StringRef N, const Elf_Sym &Sym,
                  InputSectionBase<ELFT> &Section)
-      : Defined<ELFT>(Base::DefinedRegularKind, N, Sym), Section(Section) {}
+      : Defined<ELFT>(SymbolBody::DefinedRegularKind, N, Sym),
+        Section(Section) {}
 
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::DefinedRegularKind;
+    return S->kind() == SymbolBody::DefinedRegularKind;
   }
 
   InputSectionBase<ELFT> &Section;
@@ -262,10 +263,11 @@ public:
   typedef typename Base::Elf_Sym Elf_Sym;
   DefinedSynthetic(StringRef N, const Elf_Sym &Sym,
                    OutputSectionBase<ELFT> &Section)
-      : Defined<ELFT>(Base::DefinedSyntheticKind, N, Sym), Section(Section) {}
+      : Defined<ELFT>(SymbolBody::DefinedSyntheticKind, N, Sym),
+        Section(Section) {}
 
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::DefinedSyntheticKind;
+    return S->kind() == SymbolBody::DefinedSyntheticKind;
   }
 
   const OutputSectionBase<ELFT> &Section;
@@ -281,10 +283,10 @@ public:
   static Elf_Sym Optional;
 
   Undefined(StringRef N, const Elf_Sym &Sym)
-      : ELFSymbolBody<ELFT>(Base::UndefinedKind, N, Sym) {}
+      : ELFSymbolBody<ELFT>(SymbolBody::UndefinedKind, N, Sym) {}
 
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::UndefinedKind;
+    return S->kind() == SymbolBody::UndefinedKind;
   }
 
   bool canKeepUndefined() const { return &this->Sym == &Optional; }
@@ -302,11 +304,11 @@ template <class ELFT> class SharedSymbol
 
 public:
   static bool classof(const SymbolBody *S) {
-    return S->kind() == Base::SharedKind;
+    return S->kind() == SymbolBody::SharedKind;
   }
 
   SharedSymbol(SharedFile<ELFT> *F, StringRef Name, const Elf_Sym &Sym)
-      : Defined<ELFT>(Base::SharedKind, Name, Sym), File(F) {}
+      : Defined<ELFT>(SymbolBody::SharedKind, Name, Sym), File(F) {}
 
   SharedFile<ELFT> *File;
 




More information about the llvm-commits mailing list