aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/interface.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-09-22 13:33:00 +0200
committerRon Evans <[email protected]>2022-10-19 22:23:19 +0200
commit62df1d7490ccf495dc08837ec72ee1d6042bc374 (patch)
tree379a9e4e5f46dc8293beeb3ba1f386f08bdf53c9 /compiler/interface.go
parent229746b71ef8c6ab095f0e97aa722959c6f07268 (diff)
downloadtinygo-62df1d7490ccf495dc08837ec72ee1d6042bc374.tar.gz
tinygo-62df1d7490ccf495dc08837ec72ee1d6042bc374.zip
all: remove pointer ElementType calls
This is needed for opaque pointers, which are enabled by default in LLVM 15.
Diffstat (limited to 'compiler/interface.go')
-rw-r--r--compiler/interface.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/interface.go b/compiler/interface.go
index 106c327a8..2007b7d7c 100644
--- a/compiler/interface.go
+++ b/compiler/interface.go
@@ -86,7 +86,7 @@ func (c *compilerContext) getTypeCode(typ types.Type) llvm.Value {
if _, ok := typ.Underlying().(*types.Pointer); !ok {
ptrTo = c.getTypeCode(types.NewPointer(typ))
}
- globalValue := llvm.ConstNull(global.Type().ElementType())
+ globalValue := llvm.ConstNull(global.GlobalValueType())
if !references.IsNil() {
globalValue = c.builder.CreateInsertValue(globalValue, references, 0, "")
}
@@ -533,7 +533,7 @@ func (c *compilerContext) getInterfaceInvokeWrapper(fn *ssa.Function, llvmFnType
receiverValue := b.emitPointerUnpack(wrapper.Param(0), []llvm.Type{receiverType})[0]
params := append(b.expandFormalParam(receiverValue), wrapper.Params()[1:]...)
- if llvmFn.Type().ElementType().ReturnType().TypeKind() == llvm.VoidTypeKind {
+ if llvmFnType.ReturnType().TypeKind() == llvm.VoidTypeKind {
b.CreateCall(llvmFnType, llvmFn, params, "")
b.CreateRetVoid()
} else {