[lld] r218554 - Use DenseMap::lookup. No functionality change.

Rui Ueyama ruiu at google.com
Fri Sep 26 16:21:10 PDT 2014


Author: ruiu
Date: Fri Sep 26 18:21:10 2014
New Revision: 218554

URL: http://llvm.org/viewvc/llvm-project?rev=218554&view=rev
Log:
Use DenseMap::lookup. No functionality change.

Modified:
    lld/trunk/lib/Core/Resolver.cpp

Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=218554&r1=218553&r2=218554&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Fri Sep 26 18:21:10 2014
@@ -305,10 +305,8 @@ void Resolver::markLive(const Atom *atom
   if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom)) {
     for (const Reference *ref : *defAtom)
       markLive(ref->target());
-    auto it = _reverseRef.find(defAtom);
-    if (it != _reverseRef.end())
-      for (const Atom *target : it->second)
-        markLive(target);
+    for (const Atom *target : _reverseRef.lookup(defAtom))
+      markLive(target);
   }
 }
 





More information about the llvm-commits mailing list