aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-03-19 11:15:29 -0700
committerPhilip Reames <listmail@philipreames.com>2021-03-19 11:17:19 -0700
commit5698537f81a2ecf1166f41cab264b92af670aaa1 (patch)
treeddf63abda7567ddc830bb59d2db784edd83d2f4e /llvm/lib/Analysis/CaptureTracking.cpp
parent66f340051ac2d334f30ef85251323b12cb2e6e5f (diff)
downloadllvm-5698537f81a2ecf1166f41cab264b92af670aaa1.zip
llvm-5698537f81a2ecf1166f41cab264b92af670aaa1.tar.gz
llvm-5698537f81a2ecf1166f41cab264b92af670aaa1.tar.bz2
Update basic deref API to account for possiblity of free [NFC]
This patch is plumbing to support work towards the goal outlined in the recent llvm-dev post "[llvm-dev] RFC: Decomposing deref(N) into deref(N) + nofree". The point of this change is purely to simplify iteration on other pieces on way to making the switch. Rebuilding with a change to Value.h is slow and painful, so I want to get the API change landed. Once that's done, I plan to more closely audit each caller, add the inference rules in their own patch, then post a patch with the langref changes and test diffs. The value of the command line flag is that we can exercise the inference logic in standalone patches without needing the whole switch ready to go just yet. Differential Revision: https://reviews.llvm.org/D98908
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r--llvm/lib/Analysis/CaptureTracking.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index b2fc6e6..cf5e53b 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/lib/Analysis/CaptureTracking.cpp
@@ -68,8 +68,8 @@ bool CaptureTracker::isDereferenceableOrNull(Value *O, const DataLayout &DL) {
if (auto *GEP = dyn_cast<GetElementPtrInst>(O))
if (GEP->isInBounds())
return true;
- bool CanBeNull;
- return O->getPointerDereferenceableBytes(DL, CanBeNull);
+ bool CanBeNull, CanBeFreed;
+ return O->getPointerDereferenceableBytes(DL, CanBeNull, CanBeFreed);
}
namespace {