aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-04 23:21:06 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-04 23:21:06 +0000
commitea34382dfaff899a6a9f73455d3fab56c3af0d50 (patch)
treecd73938351b39d738be7709e82150e49ea78a16b /llvm/lib/Analysis/CaptureTracking.cpp
parent7769b4a1d0f81f93181372a0657eaa0b7ad4748e (diff)
downloadllvm-ea34382dfaff899a6a9f73455d3fab56c3af0d50.zip
llvm-ea34382dfaff899a6a9f73455d3fab56c3af0d50.tar.gz
llvm-ea34382dfaff899a6a9f73455d3fab56c3af0d50.tar.bz2
[CaptureTracking] Support operand bundles conservatively
Summary: Earlier CaptureTracking would assume all "interesting" operands to a call or invoke were its arguments. With operand bundles this is no longer true. Note: an earlier change got `doesNotCapture` working correctly with operand bundles. This change uses DSE to test the changes to CaptureTracking. DSE is a vehicle for testing only, and is not directly involved in this change. Reviewers: reames, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14306 llvm-svn: 252095
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r--llvm/lib/Analysis/CaptureTracking.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index de5ec29..230a380 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/lib/Analysis/CaptureTracking.cpp
@@ -253,8 +253,9 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) {
// that loading a value from a pointer does not cause the pointer to be
// captured, even though the loaded value might be the pointer itself
// (think of self-referential objects).
- CallSite::arg_iterator B = CS.arg_begin(), E = CS.arg_end();
- for (CallSite::arg_iterator A = B; A != E; ++A)
+ CallSite::data_operand_iterator B =
+ CS.data_operands_begin(), E = CS.data_operands_end();
+ for (CallSite::data_operand_iterator A = B; A != E; ++A)
if (A->get() == V && !CS.doesNotCapture(A - B))
// The parameter is not marked 'nocapture' - captured.
if (Tracker->captured(U))