From a8bee9c76c166365effa499c15116361c40fe9ec Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 1 Mar 2021 20:21:21 -0600 Subject: [PATCH] [Attributor] Use sensible initialization in AANoCaptureCallSiteReturned --- lib/Transforms/IPO/AttributorAttributes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Transforms/IPO/AttributorAttributes.cpp b/lib/Transforms/IPO/AttributorAttributes.cpp index d6127a8df62..77c34a10867 100644 --- a/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/lib/Transforms/IPO/AttributorAttributes.cpp @@ -4478,6 +4478,13 @@ struct AANoCaptureCallSiteReturned final : AANoCaptureImpl { AANoCaptureCallSiteReturned(const IRPosition &IRP, Attributor &A) : AANoCaptureImpl(IRP, A) {} + /// See AbstractAttribute::initialize(...). + void initialize(Attributor &A) override { + const Function *F = getAnchorScope(); + // Check what state the associated function can actually capture. + determineFunctionCaptureCapabilities(getIRPosition(), *F, *this); + } + /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { STATS_DECLTRACK_CSRET_ATTR(nocapture)