compiler: really define runtime/volatile.* functions

This makes them available to deferred calls, among others.
This commit is contained in:
Ayke van Laethem
2022-06-20 14:56:55 +02:00
committed by Ron Evans
parent e1052f921c
commit 1ceb63d14c
5 changed files with 22 additions and 19 deletions
+4
View File
@@ -20,6 +20,10 @@ import (
func (b *builder) defineIntrinsicFunction() {
name := b.fn.RelString(nil)
switch {
case strings.HasPrefix(name, "runtime/volatile.Load"):
b.createVolatileLoad()
case strings.HasPrefix(name, "runtime/volatile.Store"):
b.createVolatileStore()
case strings.HasPrefix(name, "sync/atomic.") && token.IsExported(b.fn.Name()):
b.createFunctionStart()
returnValue := b.createAtomicOp(b.fn.Name())