Merge pull request #41218 from xedin/dist-watchos-32bit-issues

[Distributed] IRGen: Fix loading of the witness tables
This commit is contained in:
Pavel Yaskevich
2022-02-05 08:37:17 -08:00
committed by GitHub
4 changed files with 43 additions and 21 deletions

View File

@@ -513,15 +513,17 @@ void DistributedAccessor::emitLoadOfWitnessTables(llvm::Value *witnessTables,
IGF.Builder.emitBlock(contBB);
witnessTables = IGF.Builder.CreateBitCast(witnessTables, IGM.Int8PtrPtrTy);
witnessTables = IGF.Builder.CreateBitCast(witnessTables,
IGM.Int8PtrPtrTy->getPointerTo());
for (unsigned i = 0, n = expectedWitnessTables; i != n; ++i) {
auto offset = Size(i * IGM.getPointerSize());
auto alignment = IGM.getPointerAlignment();
auto witnessTableAddr = IGF.emitAddressAtOffset(
witnessTables, Offset(offset), IGM.Int8PtrTy, Alignment(alignment));
arguments.add(witnessTableAddr.getAddress());
witnessTables, Offset(offset), IGM.Int8PtrPtrTy, Alignment(alignment));
arguments.add(IGF.Builder.CreateLoad(witnessTableAddr));
}
}