Skip to content

Commit 864874f

Browse files
committed
Update callCapturesBefore() for new CaptureTracking logic
1 parent c7675b8 commit 864874f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Analysis/AliasAnalysis.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,13 @@ ModRefInfo AAResults::callCapturesBefore(const Instruction *I,
636636
// Only look at the no-capture or byval pointer arguments. If this
637637
// pointer were passed to arguments that were neither of these, then it
638638
// couldn't be no-capture.
639-
if (!(*CI)->getType()->isPointerTy() || !Call->doesNotCapture(ArgNo))
639+
if (!(*CI)->getType()->isPointerTy())
640+
continue;
641+
642+
// Make sure we still check captures(ret: address, provenance) arguments,
643+
// as these wouldn't be treated as a capture at the call-site.
644+
CaptureInfo Captures = Call->getCaptureInfo(ArgNo);
645+
if (!capturesNothing(Captures.getOtherComponents()))
640646
continue;
641647

642648
AliasResult AR =

0 commit comments

Comments
 (0)