File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,25 @@ void DistributedAccessor::emit() {
472
472
// so it could be forwarded to the distributed method.
473
473
computeArguments (argBuffer, argTypes, arguments);
474
474
475
+ // Add all of the substitutions to the explosion
476
+ if (auto *environment = Target->getGenericEnvironment ()) {
477
+ // swift.type **
478
+ llvm::Value *substitutionBuffer =
479
+ IGF.Builder .CreateBitCast (substitutions, IGM.TypeMetadataPtrPtrTy );
480
+
481
+ for (unsigned index : indices (environment->getGenericParams ())) {
482
+ auto offset =
483
+ Size (index * IGM.DataLayout .getTypeAllocSize (IGM.TypeMetadataPtrTy ));
484
+ auto alignment =
485
+ IGM.DataLayout .getABITypeAlignment (IGM.TypeMetadataPtrTy );
486
+
487
+ auto substitution =
488
+ IGF.emitAddressAtOffset (substitutionBuffer, Offset (offset),
489
+ IGM.TypeMetadataPtrTy , Alignment (alignment));
490
+ arguments.add (IGF.Builder .CreateLoad (substitution, " substitution" ));
491
+ }
492
+ }
493
+
475
494
// Step two, let's form and emit a call to the distributed method
476
495
// using computed argument explosion.
477
496
{
You can’t perform that action at this time.
0 commit comments