[CaptureTracking][NFCI] Expose capture tracking logic
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 8 Mar 2022 21:02:36 +0000 (15:02 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Sat, 12 Mar 2022 04:56:16 +0000 (22:56 -0600)
commitd6e09ce86fd9c8907301d150d2d2dc7166355955
tree8b0a29321d77eb8e11224c1874adedb9d3161b3c
parenta53ea51dec34e0825bc44d7789e904964c4105ff
[CaptureTracking][NFCI] Expose capture tracking logic

The logic exposed by this patch via `llvm::DetermineUseCaptureKind` was
part of `llvm::PointerMayBeCaptured`. In the Attributor we want to keep
track of the work list items but still reuse the logic if a use might
capture a value. A follow up for the Attributor removes ~100 lines of
code and complexity while making future handling of simplified values
possible.

Differential Revision: https://reviews.llvm.org/D121272
llvm/include/llvm/Analysis/CaptureTracking.h
llvm/lib/Analysis/CaptureTracking.cpp