Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.
authorMichael Gottesman <mgottesman@apple.com>
Mon, 14 Jan 2013 19:18:39 +0000 (19:18 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Mon, 14 Jan 2013 19:18:39 +0000 (19:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172452 91177308-0d34-0410-b5e6-96231b3b80d8

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");