Skip to content

Commit 642ff23

Browse files
committed
[IRGen] Distributed: Always substitute underlying method parameters into accessor context
1 parent 41ddb28 commit 642ff23

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ void DistributedAccessor::decodeArgument(unsigned argumentIdx,
384384
llvm::Value *argumentType,
385385
const SILParameterInfo &param,
386386
Explosion &arguments) {
387-
auto &paramInfo = IGM.getTypeInfo(param.getSILStorageInterfaceType());
387+
auto paramTy = Target->mapTypeIntoContext(param.getSILStorageInterfaceType());
388+
389+
auto &paramInfo = IGM.getTypeInfo(paramTy);
388390
// TODO: `emitLoad*` would actually load value witness table every
389391
// time it's called, which is sub-optimal but all of the APIs that
390392
// deal with value witness tables are currently hidden in GenOpaque.cpp
@@ -496,7 +498,6 @@ void DistributedAccessor::decodeArgument(unsigned argumentIdx,
496498

497499
case ParameterConvention::Direct_Guaranteed:
498500
case ParameterConvention::Direct_Unowned: {
499-
auto paramTy = param.getSILStorageInterfaceType();
500501
Address eltPtr = IGF.Builder.CreateElementBitCast(
501502
resultValue.getAddress(), IGM.getStorageType(paramTy));
502503

@@ -506,11 +507,12 @@ void DistributedAccessor::decodeArgument(unsigned argumentIdx,
506507
}
507508

508509
case ParameterConvention::Direct_Owned: {
510+
assert(false && "owned");
509511
// Copy the value out at +1.
510512
cast<LoadableTypeInfo>(paramInfo).loadAsCopy(IGF, resultValue.getAddress(),
511513
arguments);
512-
LoadedArguments.push_back(std::make_pair(
513-
resultValue.getAddress(), param.getSILStorageInterfaceType()));
514+
LoadedArguments.push_back(
515+
std::make_pair(resultValue.getAddress(), paramTy));
514516
break;
515517
}
516518
}

0 commit comments

Comments
 (0)