Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.
[oota-llvm.git] / lib / Transforms / Scalar / ObjCARC.cpp
index e7c51780411a0559a7293cbb80701d70118eb8e9..abd6b4185f6305f82f2a0cf747b8cb0fb8f9cb06 100644 (file)
@@ -662,10 +662,9 @@ static bool DoesObjCBlockEscape(const Value *BlockPtr) {
         if (isa<BitCastInst>(UUser) || isa<GetElementPtrInst>(UUser) ||
             isa<PHINode>(UUser) || isa<SelectInst>(UUser)) {
 
-          if (!VisitedSet.count(UUser)) {
+          if (!VisitedSet.insert(UUser)) {
             DEBUG(dbgs() << "DoesObjCBlockEscape: User copies value. Escapes "
                             "if result escapes. Adding to list.\n");
-            VisitedSet.insert(V);
             Worklist.push_back(UUser);
           } else {
             DEBUG(dbgs() << "DoesObjCBlockEscape: Already visited node.\n");