diff options
author | Ayke van Laethem <[email protected]> | 2022-09-21 13:55:32 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-10-19 22:23:19 +0200 |
commit | 7b6a9fab4206bde1a11c3a8d79631a0e8ac71a82 (patch) | |
tree | edacd9c30e7f6d6aec8e4d084e800c964aaa12b6 /compiler/channel.go | |
parent | 6bc6de8f829786e84e01b97d1f452505a83047b1 (diff) | |
download | tinygo-7b6a9fab4206bde1a11c3a8d79631a0e8ac71a82.tar.gz tinygo-7b6a9fab4206bde1a11c3a8d79631a0e8ac71a82.zip |
all: add type parameter to CreateLoad
This is needed for LLVM 15.
Diffstat (limited to 'compiler/channel.go')
-rw-r--r-- | compiler/channel.go | 8 |
1 files changed, 4 insertions, 4 deletions
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, "") } } |