Skip to content

Commit 0659e16

Browse files
committed
[SILGen] Use decl for noImplicitCopy attr.
Rather than using the SILValue of the ManagedValue generated for that argument, which is not always a SILFunctionArgument, just look directly at the ParmDecl for the attribute.
1 parent 93a78b4 commit 0659e16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILGen/SILGenProlog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ struct ArgumentInitHelper {
264264
if (!SGF.getASTContext().SILOpts.supportsLexicalLifetimes(SGF.getModule()))
265265
return value;
266266

267-
bool isNoImplicitCopy = false;
268-
if (auto *arg = dyn_cast<SILFunctionArgument>(value))
269-
isNoImplicitCopy = arg->isNoImplicitCopy();
267+
// Look for the following annotations on the function argument:
268+
// - @noImplicitCopy
269+
auto isNoImplicitCopy = pd->isNoImplicitCopy();
270270

271271
// If we have a no implicit copy argument and the argument is trivial,
272272
// we need to use copyable to move only to convert it to its move only

0 commit comments

Comments
 (0)