Simplify. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Aug 2017 18:42:04 +0000 (18:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Aug 2017 18:42:04 +0000 (18:42 +0000)
llvm-svn: 310090

lld/ELF/MapFile.cpp

index 58ad4f3..ed0961c 100644 (file)
@@ -52,10 +52,10 @@ template <class ELFT> static std::vector<DefinedRegular *> getSymbols() {
   std::vector<DefinedRegular *> V;
   for (ObjFile<ELFT> *File : ObjFile<ELFT>::Instances)
     for (SymbolBody *B : File->getSymbols())
-      if (B->File == File && !B->isSection())
-        if (auto *Sym = dyn_cast<DefinedRegular>(B))
-          if (Sym->Section && Sym->Section->Live)
-            V.push_back(Sym);
+      if (auto *DR = dyn_cast<DefinedRegular>(B))
+        if (DR->File == File && !DR->isSection() && DR->Section &&
+            DR->Section->Live)
+          V.push_back(DR);
   return V;
 }