mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil] Add a new attribute called @closureCaptured to SILFunctionArguments that are closure capture arguments.
I am adding this to make it easy to determine if a SILFunction that is not inout aliasable is captured. This is useful when emitting certain types of diagnostics like I need to emit with move only.
This commit is contained in:
@@ -801,10 +801,7 @@ PromotedParamCloner::populateCloned() {
|
||||
Cloned->getModule().Types, 0);
|
||||
auto *promotedArg =
|
||||
ClonedEntryBB->createFunctionArgument(promotedTy, (*I)->getDecl());
|
||||
promotedArg->setNoImplicitCopy(
|
||||
cast<SILFunctionArgument>(*I)->isNoImplicitCopy());
|
||||
promotedArg->setLifetimeAnnotation(
|
||||
cast<SILFunctionArgument>(*I)->getLifetimeAnnotation());
|
||||
promotedArg->copyFlags(cast<SILFunctionArgument>(*I));
|
||||
OrigPromotedParameters.insert(*I);
|
||||
|
||||
NewPromotedArgs[ArgNo] = promotedArg;
|
||||
@@ -819,10 +816,7 @@ PromotedParamCloner::populateCloned() {
|
||||
// Create a new argument which copies the original argument.
|
||||
auto *newArg = ClonedEntryBB->createFunctionArgument((*I)->getType(),
|
||||
(*I)->getDecl());
|
||||
newArg->setNoImplicitCopy(
|
||||
cast<SILFunctionArgument>(*I)->isNoImplicitCopy());
|
||||
newArg->setLifetimeAnnotation(
|
||||
cast<SILFunctionArgument>(*I)->getLifetimeAnnotation());
|
||||
newArg->copyFlags(cast<SILFunctionArgument>(*I));
|
||||
entryArgs.push_back(newArg);
|
||||
}
|
||||
++ArgNo;
|
||||
|
||||
Reference in New Issue
Block a user