mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
all: replace llvm.Const* calls with builder.Create* calls
A number of llvm.Const* functions (in particular extractvalue and insertvalue) were removed in LLVM 15, so we have to use a builder instead. This builder will create the same constant values, it simply uses a different API.
This commit is contained in:
committed by
Ron Evans
parent
f57cffce2d
commit
09ec846c9f
@@ -44,7 +44,8 @@ func LowerInterrupts(mod llvm.Module) []error {
|
||||
|
||||
// Get the interrupt number from the initializer
|
||||
initializer := global.Initializer()
|
||||
num := llvm.ConstExtractValue(initializer, []uint32{2, 0}).SExtValue()
|
||||
interrupt := builder.CreateExtractValue(initializer, 2, "")
|
||||
num := builder.CreateExtractValue(interrupt, 0, "").SExtValue()
|
||||
pkg := packageFromInterruptHandle(global)
|
||||
|
||||
handles, exists := handleMap[num]
|
||||
@@ -89,8 +90,8 @@ func LowerInterrupts(mod llvm.Module) []error {
|
||||
builder.SetInsertPointBefore(call)
|
||||
for _, handler := range handlers {
|
||||
initializer := handler.Initializer()
|
||||
context := llvm.ConstExtractValue(initializer, []uint32{0})
|
||||
funcPtr := llvm.ConstExtractValue(initializer, []uint32{1}).Operand(0)
|
||||
context := builder.CreateExtractValue(initializer, 0, "")
|
||||
funcPtr := builder.CreateExtractValue(initializer, 1, "").Operand(0)
|
||||
builder.CreateCall(funcPtr.GlobalValueType(), funcPtr, []llvm.Value{
|
||||
num,
|
||||
context,
|
||||
|
||||
Reference in New Issue
Block a user