[lld] r244040 - Delete dead code.

Rafael Espindola rafael.espindola at gmail.com
Wed Aug 5 06:26:55 PDT 2015


Author: rafael
Date: Wed Aug  5 08:26:54 2015
New Revision: 244040

URL: http://llvm.org/viewvc/llvm-project?rev=244040&view=rev
Log:
Delete dead code.

Modified:
    lld/trunk/ELF/SymbolTable.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=244040&r1=244039&r2=244040&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Aug  5 08:26:54 2015
@@ -34,8 +34,7 @@ void SymbolTable::addObject(ObjectFileBa
 
   ObjectFiles.emplace_back(File);
   for (SymbolBody *Body : File->getSymbols())
-    if (Body->isExternal())
-      resolve(Body);
+    resolve(Body);
 }
 
 void SymbolTable::reportRemainingUndefines() {

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=244040&r1=244039&r2=244040&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Aug  5 08:26:54 2015
@@ -28,10 +28,8 @@ getSymbolName(const llvm::object::ELFFil
 
 template <class ELFT>
 DefinedRegular<ELFT>::DefinedRegular(ObjectFile<ELFT> *F, const Elf_Sym *S)
-    : Defined(DefinedRegularKind, getSymbolName<ELFT>(F->getObj(), S)), File(F),
-      Sym(S) {
-  IsExternal = S->isExternal();
-}
+    : Defined(DefinedRegularKind, getSymbolName<ELFT>(F->getObj(), S)),
+      File(F) {}
 
 // Returns 1, 0 or -1 if this symbol should take precedence
 // over the Other, tie or lose, respectively.

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=244040&r1=244039&r2=244040&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Wed Aug  5 08:26:54 2015
@@ -43,9 +43,6 @@ public:
 
   Kind kind() const { return static_cast<Kind>(SymbolKind); }
 
-  // Returns true if this is an external symbol.
-  bool isExternal() const { return true; }
-
   // Returns the symbol name.
   StringRef getName() const { return Name; }
 
@@ -65,11 +62,10 @@ public:
 
 protected:
   SymbolBody(Kind K, StringRef N = "")
-      : SymbolKind(K), IsExternal(true), Name(N) {}
+      : SymbolKind(K), Name(N) {}
 
 protected:
   const unsigned SymbolKind : 8;
-  unsigned IsExternal : 1;
   StringRef Name;
   Symbol *Backref = nullptr;
 };
@@ -99,7 +95,6 @@ public:
 
 private:
   ObjectFile<ELFT> *File;
-  const Elf_Sym *Sym;
 };
 
 // Undefined symbols.




More information about the llvm-commits mailing list