aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/values.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2019-09-15 16:42:31 +0200
committerRon Evans <[email protected]>2019-09-15 19:09:10 +0200
commit10ed3decb076c88077ccd849029357e1c2c33f7c (patch)
tree8c78d0c16530e61ff3315f1051f9315ea915d1fa /interp/values.go
parent8d959b7c636a392046558046e9b423efb2c288bb (diff)
downloadtinygo-10ed3decb076c88077ccd849029357e1c2c33f7c.tar.gz
tinygo-10ed3decb076c88077ccd849029357e1c2c33f7c.zip
compiler: rename getZeroValue to llvm.ConstNull
It does the same thing but should be more complete, and it probably is faster as well (just one CGo call instead of several).
Diffstat (limited to 'interp/values.go')
-rw-r--r--interp/values.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/interp/values.go b/interp/values.go
index 4a1b9739e..ae62f3ffe 100644
--- a/interp/values.go
+++ b/interp/values.go
@@ -162,7 +162,7 @@ func (v *MapValue) newBucket() llvm.Value {
llvm.ArrayType(v.KeyType, 8), // key type
llvm.ArrayType(v.ValueType, 8), // value type
}, false)
- bucketValue := getZeroValue(bucketType)
+ bucketValue := llvm.ConstNull(bucketType)
bucket := llvm.AddGlobal(v.Eval.Mod, bucketType, v.PkgName+"$mapbucket")
bucket.SetInitializer(bucketValue)
bucket.SetLinkage(llvm.InternalLinkage)
@@ -311,7 +311,7 @@ func (v *MapValue) PutString(keyBuf, keyLen, valPtr *LocalValue) {
keyType := v.Eval.Mod.GetTypeByName("runtime._string")
v.KeyType = keyType
- key := getZeroValue(keyType)
+ key := llvm.ConstNull(keyType)
key = llvm.ConstInsertValue(key, keyBuf.Value(), []uint32{0})
key = llvm.ConstInsertValue(key, keyLen.Value(), []uint32{1})