Skip to content

Commit 00e1685

Browse files
committed
Rename 'Threshold' to a more specific variable name.
1 parent c7a4637 commit 00e1685

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: lib/SILAnalysis/ValueTracking.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static bool isTransitiveEscapeInst(SILInstruction *Inst) {
185185
}
186186

187187
/// Maximum amount of ValueCapture queries.
188-
static unsigned const Threshold = 32;
188+
static unsigned const ValueCaptureSearchThreshold = 32;
189189

190190
namespace {
191191

@@ -205,8 +205,8 @@ enum CaptureException : unsigned {
205205
/// case to be conservative, we must assume it is captured.
206206
/// FIXME: Maybe put this on SILValue?
207207
static bool valueMayBeCaptured(SILValue V, CaptureException Exception) {
208-
llvm::SmallVector<Operand *, Threshold> Worklist;
209-
llvm::SmallPtrSet<Operand *, Threshold> Visited;
208+
llvm::SmallVector<Operand *, ValueCaptureSearchThreshold> Worklist;
209+
llvm::SmallPtrSet<Operand *, ValueCaptureSearchThreshold> Visited;
210210
unsigned Count = 0;
211211

212212
DEBUG(llvm::dbgs() << " Checking for capture.\n");
@@ -216,7 +216,7 @@ static bool valueMayBeCaptured(SILValue V, CaptureException Exception) {
216216
for (auto *UI : V.getUses()) {
217217
// If we have more uses than the threshold, be conservative and bail so we
218218
// don't use too much compile time.
219-
if (Count++ >= Threshold)
219+
if (Count++ >= ValueCaptureSearchThreshold)
220220
return true;
221221
Visited.insert(UI);
222222
Worklist.push_back(UI);
@@ -238,7 +238,7 @@ static bool valueMayBeCaptured(SILValue V, CaptureException Exception) {
238238
for (auto *UI : Inst->getUses()) {
239239
// If we have more uses than the threshold, be conservative and bail
240240
// so we don't use too much compile time.
241-
if (Count++ >= Threshold)
241+
if (Count++ >= ValueCaptureSearchThreshold)
242242
return true;
243243

244244
if (Visited.insert(UI).second) {

0 commit comments

Comments
 (0)