all: add type parameter to CreateCall

This uses LLVMBuildCall2 in the background, which is the replacement for
the deprecated LLVMBuildCall function.
This commit is contained in:
Ayke van Laethem
2022-09-21 00:37:01 +02:00
committed by Ron Evans
parent b79bf29c11
commit 6bc6de8f82
26 changed files with 123 additions and 103 deletions
+3 -3
View File
@@ -124,12 +124,12 @@ func ExternalInt64AsPtr(mod llvm.Module, config *compileopts.Config) error {
// Pass a stack-allocated pointer as the first parameter
// where the return value should be stored, instead of using
// the regular return value.
builder.CreateCall(externalFn, callParams, callName)
builder.CreateCall(externalFnType, externalFn, callParams, callName)
returnValue := builder.CreateLoad(retvalAlloca, "retval")
call.ReplaceAllUsesWith(returnValue)
call.EraseFromParentAsInstruction()
} else {
newCall := builder.CreateCall(externalFn, callParams, callName)
newCall := builder.CreateCall(externalFnType, externalFn, callParams, callName)
call.ReplaceAllUsesWith(newCall)
call.EraseFromParentAsInstruction()
}
@@ -156,7 +156,7 @@ func ExternalInt64AsPtr(mod llvm.Module, config *compileopts.Config) error {
}
callParams = append(callParams, paramValue)
}
retval := builder.CreateCall(fn, callParams, "")
retval := builder.CreateCall(fn.GlobalValueType(), fn, callParams, "")
if retval.Type().TypeKind() == llvm.VoidTypeKind {
builder.CreateRetVoid()
} else {