Merge pull request #61304 from nate-chandler/transfer-sil-function-argument-attrs

[SILOptimizer] Preserve arg attrs at cloning.
This commit is contained in:
nate-chandler
2022-09-27 08:05:19 -07:00
committed by GitHub
19 changed files with 480 additions and 16 deletions

View File

@@ -123,8 +123,10 @@ void SILBasicBlock::cloneArgumentList(SILBasicBlock *Other) {
if (isEntry()) {
assert(args_empty() && "Expected to have no arguments");
for (auto *FuncArg : Other->getSILFunctionArguments()) {
createFunctionArgument(FuncArg->getType(),
FuncArg->getDecl());
auto *NewArg =
createFunctionArgument(FuncArg->getType(), FuncArg->getDecl());
NewArg->setNoImplicitCopy(FuncArg->isNoImplicitCopy());
NewArg->setLifetimeAnnotation(FuncArg->getLifetimeAnnotation());
}
return;
}