mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
CopyForwarding: We need to check whether an argument is a function argument before checking its convention
This commit is contained in:
@@ -93,6 +93,8 @@ static llvm::cl::opt<bool> EnableDestroyHoisting("enable-destroyhoisting",
|
||||
/// (2) A local alloc_stack variable.
|
||||
static bool isIdentifiedSourceValue(SILValue Def) {
|
||||
if (SILArgument *Arg = dyn_cast<SILArgument>(Def)) {
|
||||
if (!Arg->isFunctionArg())
|
||||
return false;
|
||||
// Check that the argument is passed as an in type. This means there are
|
||||
// no aliases accessible within this function scope.
|
||||
ParameterConvention Conv = Arg->getParameterInfo().getConvention();
|
||||
|
||||
Reference in New Issue
Block a user