[PATCH] Do not check deadStripNever twice.

Rui Ueyama ruiu at google.com
Thu Apr 3 14:49:43 PDT 2014


Hi Bigcheese, shankarke, kledzik,

Atoms with deadStripNever attribute has already been added to the
dead strip root set at end of Resolver::doDefinedAtom, so no need
to check it for each atom again.

http://llvm-reviews.chandlerc.com/D3282

Files:
  lib/Core/Resolver.cpp

Index: lib/Core/Resolver.cpp
===================================================================
--- lib/Core/Resolver.cpp
+++ lib/Core/Resolver.cpp
@@ -37,15 +37,8 @@
   explicit NotLive(const llvm::DenseSet<const Atom *> &la) : _liveAtoms(la) {}
 
   bool operator()(const Atom *atom) const {
-    // don't remove if live
-    if (_liveAtoms.count(atom))
-      return false;
-    // don't remove if marked never-dead-strip
-    if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom))
-      if (defAtom->deadStrip() == DefinedAtom::deadStripNever)
-        return false;
-    // do remove this atom
-    return true;
+    // Remove this atom if it's not marked as live.
+    return _liveAtoms.count(atom) == 0;
   }
 
 private:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3282.1.patch
Type: text/x-patch
Size: 737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140403/955b0f5b/attachment.bin>


More information about the llvm-commits mailing list