Skip to content

Commit d398079

Browse files
committed
Update callCapturesBefore() for new CaptureTracking logic
1 parent 38dcd5f commit d398079

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
@@ -635,7 +635,13 @@ ModRefInfo AAResults::callCapturesBefore(const Instruction *I,
635635
// Only look at the no-capture or byval pointer arguments. If this
636636
// pointer were passed to arguments that were neither of these, then it
637637
// couldn't be no-capture.
638-
if (!(*CI)->getType()->isPointerTy() || !Call->doesNotCapture(ArgNo))
638+
if (!(*CI)->getType()->isPointerTy())
639+
continue;
640+
641+
// Make sure we still check captures(ret: address, provenance) arguments,
642+
// as these wouldn't be treated as a capture at the call-site.
643+
CaptureInfo Captures = Call->getCaptureInfo(ArgNo);
644+
if (!capturesNothing(Captures.getOtherComponents()))
639645
continue;
640646

641647
AliasResult AR =

0 commit comments

Comments
 (0)