Replace compiler hack for sync package with //go:linkname

This commit is contained in:
Ayke van Laethem
2018-08-30 22:38:21 +02:00
parent 74bd378c29
commit 674b506bb2
2 changed files with 13 additions and 5 deletions
-5
View File
@@ -1325,11 +1325,6 @@ func (c *Compiler) parseBuiltin(frame *Frame, args []ssa.Value, callName string)
}
func (c *Compiler) parseFunctionCall(frame *Frame, args []ssa.Value, llvmFn llvm.Value, blocking bool, parentHandle llvm.Value) (llvm.Value, error) {
if llvmFn.Name() == "sync.runtime_registerPoolCleanup" || llvmFn.Name() == "sync.runtime_notifyListCheck" {
// Ignore these functions calls for now, as a hack.
// TODO: implement //go:linkname.
return llvm.Value{}, nil
}
var params []llvm.Value
if blocking {
if parentHandle.IsNil() {
+13
View File
@@ -0,0 +1,13 @@
package runtime
// This file contains support code for the sync package.
//go:linkname registerPoolCleanup sync.runtime_registerPoolCleanup
func registerPoolCleanup(cleanup func()) {
// Ignore.
}
//go:linkname notifyListCheck sync.runtime_notifyListCheck
func notifyListCheck(size uintptr) {
// Ignore.
}