Reuse the Threshold value to size these containers because it's
authorDan Gohman <gohman@apple.com>
Wed, 9 Dec 2009 18:48:53 +0000 (18:48 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 9 Dec 2009 18:48:53 +0000 (18:48 +0000)
currently somewhat convenient for them to have the same value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90980 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CaptureTracking.cpp

index 007b28278975cd205e561f4e53be527fb77bbfb5..10a8b1165df6445c6b80927fee8dfe51051c76ab 100644 (file)
@@ -45,8 +45,8 @@ static int const Threshold = 20;
 bool llvm::PointerMayBeCaptured(const Value *V,
                                 bool ReturnCaptures, bool StoreCaptures) {
   assert(isa<PointerType>(V->getType()) && "Capture is for pointers only!");
-  SmallVector<Use*, 20> Worklist;
-  SmallSet<Use*, 20> Visited;
+  SmallVector<Use*, Threshold> Worklist;
+  SmallSet<Use*, Threshold> Visited;
   int Count = 0;
 
   for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();