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
@@ -53,11 +53,11 @@ const (
// getFunction returns the LLVM function for the given *ssa.Function, creating
// it if needed. It can later be filled with compilerContext.createFunction().
func (c *compilerContext) getFunction(fn *ssa.Function) llvm.Value {
func (c *compilerContext) getFunction(fn *ssa.Function) (llvm.Type, llvm.Value) {
info := c.getFunctionInfo(fn)
llvmFn := c.mod.NamedFunction(info.linkName)
if !llvmFn.IsNil() {
return llvmFn
return llvmFn.GlobalValueType(), llvmFn
}
var retType llvm.Type
@@ -202,7 +202,7 @@ func (c *compilerContext) getFunction(fn *ssa.Function) llvm.Value {
llvmFn.SetUnnamedAddr(true)
}
return llvmFn
return fnType, llvmFn
}
// getFunctionInfo returns information about a function that is not directly