================
@@ -5742,27 +5742,36 @@ bool AANoCapture::isImpliedByIR(Attributor &A, const
IRPosition &IRP,
return true;
}
- if (A.hasAttr(IRP, {Attribute::NoCapture},
- /* IgnoreSubsumingPositions */ true, Attribute::NoCapture))
- return true;
+ SmallVector<Attribute, 1> Attrs;
+ A.getAttrs(IRP, {Attribute::Captures}, Attrs,
+ /* IgnoreSubsumingPositions */ true);
+ for (const Attribute &Attr : Attrs)
+ if (capturesNothing(Attr.getCaptureInfo()))
+ return true;
if (IRP.getPositionKind() == IRP_CALL_SITE_ARGUMENT)
- if (Argument *Arg = IRP.getAssociatedArgument())
- if (A.hasAttr(IRPosition::argument(*Arg),
- {Attribute::NoCapture, Attribute::ByVal},
- /* IgnoreSubsumingPositions */ true)) {
- A.manifestAttrs(IRP,
- Attribute::get(V.getContext(), Attribute::NoCapture));
+ if (Argument *Arg = IRP.getAssociatedArgument()) {
+ SmallVector<Attribute, 1> Attrs;
----------------
goldsteinn wrote:
2? Or default?
https://github.com/llvm/llvm-project/pull/123181
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits