From 7b6a9fab4206bde1a11c3a8d79631a0e8ac71a82 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 21 Sep 2022 13:55:32 +0200 Subject: all: add type parameter to CreateLoad This is needed for LLVM 15. --- compiler/channel.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/channel.go') diff --git a/compiler/channel.go b/compiler/channel.go index a9886e100..5c3b6c596 100644 --- a/compiler/channel.go +++ b/compiler/channel.go @@ -84,7 +84,7 @@ func (b *builder) createChanRecv(unop *ssa.UnOp) llvm.Value { if isZeroSize { received = llvm.ConstNull(valueType) } else { - received = b.CreateLoad(valueAlloca, "chan.received") + received = b.CreateLoad(valueType, valueAlloca, "chan.received") b.emitLifetimeEnd(valueAllocaCast, valueAllocaSize) } b.emitLifetimeEnd(channelBlockedListAllocaCast, channelBlockedListAllocaSize) @@ -264,8 +264,8 @@ func (b *builder) getChanSelectResult(expr *ssa.Extract) llvm.Value { // receive can proceed at a time) so we'll get that alloca, bitcast // it to the correct type, and dereference it. recvbuf := b.selectRecvBuf[expr.Tuple.(*ssa.Select)] - typ := llvm.PointerType(b.getLLVMType(expr.Type()), 0) - ptr := b.CreateBitCast(recvbuf, typ, "") - return b.CreateLoad(ptr, "") + typ := b.getLLVMType(expr.Type()) + ptr := b.CreateBitCast(recvbuf, llvm.PointerType(typ, 0), "") + return b.CreateLoad(typ, ptr, "") } } -- cgit v1.2.3