[lld] r198040 - Remove unnecessary call of DenseMap::clear.

Rui Ueyama ruiu at google.com
Thu Dec 26 00:11:06 PST 2013


Author: ruiu
Date: Thu Dec 26 02:11:06 2013
New Revision: 198040

URL: http://llvm.org/viewvc/llvm-project?rev=198040&view=rev
Log:
Remove unnecessary call of DenseMap::clear.

It should be always true that _liveAtoms is empty, so we don't have to clear it.
Add an assert() instead.

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=198040&r1=198039&r2=198040&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Thu Dec 26 02:11:06 2013
@@ -328,9 +328,7 @@ void Resolver::deadStripOptimize() {
   // only do this optimization with -dead_strip
   if (!_context.deadStrip())
     return;
-
-  // clear liveness on all atoms
-  _liveAtoms.clear();
+  assert(_liveAtoms.empty());
 
   // By default, shared libraries are built with all globals as dead strip roots
   if (_context.globalsAreDeadStripRoots()) {





More information about the llvm-commits mailing list