diff --git a/llvm/lib/Transforms/Scalar/ObjCARC.cpp b/llvm/lib/Transforms/Scalar/ObjCARC.cpp index e7c51780411a..abd6b4185f63 100644 --- a/llvm/lib/Transforms/Scalar/ObjCARC.cpp +++ b/llvm/lib/Transforms/Scalar/ObjCARC.cpp @@ -662,10 +662,9 @@ static bool DoesObjCBlockEscape(const Value *BlockPtr) { if (isa(UUser) || isa(UUser) || isa(UUser) || isa(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");