[lld] r296695 - Remove useless variables and declarations.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 14:24:46 PST 2017


Author: ruiu
Date: Wed Mar  1 16:24:46 2017
New Revision: 296695

URL: http://llvm.org/viewvc/llvm-project?rev=296695&view=rev
Log:
Remove useless variables and declarations.

Modified:
    lld/trunk/ELF/GdbIndex.cpp
    lld/trunk/ELF/GdbIndex.h
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/GdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.cpp?rev=296695&r1=296694&r2=296695&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.cpp (original)
+++ lld/trunk/ELF/GdbIndex.cpp Wed Mar  1 16:24:46 2017
@@ -122,10 +122,9 @@ GdbIndexBuilder<ELFT>::readPubNamesAndTy
 }
 
 std::pair<bool, GdbSymbol *> GdbHashTab::add(uint32_t Hash, size_t Offset) {
-  GdbSymbol *&Sym = Map[{Hash, Offset}];
+  GdbSymbol *&Sym = Map[Offset];
   if (Sym)
     return {false, Sym};
-  ++Size;
   Sym = make<GdbSymbol>(Hash, Offset);
   return {true, Sym};
 }

Modified: lld/trunk/ELF/GdbIndex.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.h?rev=296695&r1=296694&r2=296695&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.h (original)
+++ lld/trunk/ELF/GdbIndex.h Wed Mar  1 16:24:46 2017
@@ -75,13 +75,8 @@ public:
   GdbSymbol *getSymbol(size_t I) { return Table[I]; }
 
 private:
-  GdbSymbol **findSlot(uint32_t Hash, size_t Offset);
-
-  llvm::DenseMap<std::pair<uint32_t, size_t>, GdbSymbol *> Map;
+  llvm::DenseMap<size_t, GdbSymbol *> Map;
   std::vector<GdbSymbol *> Table;
-
-  // Size keeps the amount of filled entries in Table.
-  size_t Size = 0;
 };
 
 } // namespace elf

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=296695&r1=296694&r2=296695&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar  1 16:24:46 2017
@@ -1730,9 +1730,7 @@ template <class ELFT> void GdbIndexSecti
       continue;
     }
 
-    std::vector<std::pair<uint32_t, uint8_t>> &CuVec =
-        CuVectors[Sym->CuVectorIndex];
-    CuVec.push_back({CuId, Pair.second});
+    CuVectors[Sym->CuVectorIndex].push_back({CuId, Pair.second});
   }
 }
 




More information about the llvm-commits mailing list