mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
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:
committed by
Ron Evans
parent
b79bf29c11
commit
6bc6de8f82
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user