all: add type parameter to *GEP calls

This is necessary for LLVM 15.
This commit is contained in:
Ayke van Laethem
2022-09-21 17:00:09 +02:00
committed by Ron Evans
parent 7b6a9fab42
commit f57cffce2d
13 changed files with 69 additions and 60 deletions
+1 -1
View File
@@ -1146,7 +1146,7 @@ func setGlobalValues(mod llvm.Module, globals map[string]map[string]string) erro
// Create the string value, which is a {ptr, len} pair.
zero := llvm.ConstInt(mod.Context().Int32Type(), 0, false)
ptr := llvm.ConstGEP(buf, []llvm.Value{zero, zero})
ptr := llvm.ConstGEP(bufInitializer.Type(), buf, []llvm.Value{zero, zero})
if ptr.Type() != elementTypes[0] {
return fmt.Errorf("%s: not a string", globalName)
}