diff options
author | ray <ray@FreeBSD.org> | 2013-12-05 00:57:53 +0000 |
---|---|---|
committer | ray <ray@FreeBSD.org> | 2013-12-05 00:57:53 +0000 |
commit | 1af064917e022f18acbf9fc2942cd40f1b26fbe5 (patch) | |
tree | ef10954b063bcd6939eabdcc7ecba95432634f70 /contrib/llvm/lib/Analysis/CaptureTracking.cpp | |
parent | 40d47a9dd8116c90080a010ab3483d8917bd0524 (diff) | |
parent | 6e411c7e1916ef76b0aa51ded38fa235d3313371 (diff) | |
download | FreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.zip FreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.tar.gz |
MFC @r258947.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r-- | contrib/llvm/lib/Analysis/CaptureTracking.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Analysis/CaptureTracking.cpp b/contrib/llvm/lib/Analysis/CaptureTracking.cpp index a729270..2118917 100644 --- a/contrib/llvm/lib/Analysis/CaptureTracking.cpp +++ b/contrib/llvm/lib/Analysis/CaptureTracking.cpp @@ -146,8 +146,14 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) { case Instruction::PHI: case Instruction::Select: // The original value is not captured via this if the new value isn't. + Count = 0; for (Instruction::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; ++UI) { + // If there are lots of uses, conservatively say that the value + // is captured to avoid taking too much compile time. + if (Count++ >= Threshold) + return Tracker->tooManyUses(); + Use *U = &UI.getUse(); if (Visited.insert(U)) if (Tracker->shouldExplore(U)) |