aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder
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 /builder
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 'builder')
-rw-r--r--builder/build.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/builder/build.go b/builder/build.go
index 7a6b9dbb9..17a007f85 100644
--- a/builder/build.go
+++ b/builder/build.go
@@ -411,7 +411,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
return errors.New("global not found: " + globalName)
}
name := global.Name()
- newGlobal := llvm.AddGlobal(mod, global.Type().ElementType(), name+".tmp")
+ newGlobal := llvm.AddGlobal(mod, global.GlobalValueType(), name+".tmp")
global.ReplaceAllUsesWith(newGlobal)
global.EraseFromParentAsGlobal()
newGlobal.SetName(name)
@@ -1127,7 +1127,7 @@ func setGlobalValues(mod llvm.Module, globals map[string]map[string]string) erro
// A strin is a {ptr, len} pair. We need these types to build the
// initializer.
- initializerType := global.Type().ElementType()
+ initializerType := global.GlobalValueType()
if initializerType.TypeKind() != llvm.StructTypeKind || initializerType.StructName() == "" {
return fmt.Errorf("%s: not a string", globalName)
}