summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/CaptureTracking.h
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-12-28 23:24:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-12-28 23:24:21 +0000
commitb48a18903a5769f0ecb295db069252576b1388b0 (patch)
tree6536862781402e176a196c81e6f25a3b69ac9cbf /include/llvm/Analysis/CaptureTracking.h
parentda813f420907ad29802ce9e80238258a48385212 (diff)
downloadllvm-b48a18903a5769f0ecb295db069252576b1388b0.tar.gz
llvm-b48a18903a5769f0ecb295db069252576b1388b0.tar.bz2
llvm-b48a18903a5769f0ecb295db069252576b1388b0.tar.xz
Change CaptureTracking to pass a Use* instead of a Value* when a value is
captured. This allows the tracker to look at the specific use, which may be especially interesting for function calls. Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does not iterate until a fixpoint and does not guarantee that it produces the same result regardless of iteration order. The new implementation builds up a graph of how arguments are passed from function to function, and uses a bottom-up walk on the argument-SCCs to assign nocapture. This gets us nocapture more often, and does so rather efficiently and independent of iteration order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/CaptureTracking.h')
-rw-r--r--include/llvm/Analysis/CaptureTracking.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Analysis/CaptureTracking.h b/include/llvm/Analysis/CaptureTracking.h
index 01eca6041e..f2e72535cd 100644
--- a/include/llvm/Analysis/CaptureTracking.h
+++ b/include/llvm/Analysis/CaptureTracking.h
@@ -50,10 +50,10 @@ namespace llvm {
/// U->getUser() is always an Instruction.
virtual bool shouldExplore(Use *U) = 0;
- /// captured - The instruction I captured the pointer. Return true to
- /// stop the traversal or false to continue looking for more capturing
- /// instructions.
- virtual bool captured(Instruction *I) = 0;
+ /// captured - Information about the pointer was captured by the user of
+ /// use U. Return true to stop the traversal or false to continue looking
+ /// for more capturing instructions.
+ virtual bool captured(Use *U) = 0;
};
/// PointerMayBeCaptured - Visit the value and the values derived from it and