mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
compiler: implement clear builtin for maps
This commit is contained in:
committed by
Ron Evans
parent
a2f886a67a
commit
f1e25a18d2
@@ -185,6 +185,11 @@ func (b *builder) createMapDelete(keyType types.Type, m, key llvm.Value, pos tok
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the given map.
|
||||
func (b *builder) createMapClear(m llvm.Value) {
|
||||
b.createRuntimeCall("hashmapClear", []llvm.Value{m}, "")
|
||||
}
|
||||
|
||||
// createMapIteratorNext lowers the *ssa.Next instruction for iterating over a
|
||||
// map. It returns a tuple of {bool, key, value} with the result of the
|
||||
// iteration.
|
||||
|
||||
Reference in New Issue
Block a user