Replace _llvm_* workaround in the scheduler with //go:linkname

This also removes the need for the _llvm_ special case in the compiler.
And it makes the scheduler code a whole lot nicer!
This commit is contained in:
Ayke van Laethem
2018-08-30 22:29:06 +02:00
parent 771f23e320
commit 74bd378c29
2 changed files with 55 additions and 59 deletions
+1 -6
View File
@@ -176,12 +176,7 @@ func (f *Function) LinkName() string {
// Name CGo functions directly.
return name
} else {
name := f.fn.RelString(nil)
if f.fn.Pkg.Pkg.Path() == "runtime" && strings.HasPrefix(f.fn.Name(), "_llvm_") {
// Special case for LLVM intrinsics in the runtime.
name = "llvm." + strings.Replace(f.fn.Name()[len("_llvm_"):], "_", ".", -1)
}
return name
return f.fn.RelString(nil)
}
}
}