Simplify function names by removing $async suffix

This commit is contained in:
Ayke van Laethem
2018-08-26 21:45:28 +02:00
parent 58e31fd470
commit 309de00fd6
3 changed files with 15 additions and 31 deletions
+3 -7
View File
@@ -125,21 +125,17 @@ func (p *Program) GetGlobal(ssaGlobal *ssa.Global) *Global {
}
// Return the link name for this function.
func (f *Function) LinkName(blocking bool) string {
suffix := ""
if blocking {
suffix = "$async"
}
func (f *Function) LinkName() string {
if f.fn.Signature.Recv() != nil {
// Method on a defined type (which may be a pointer).
return f.fn.RelString(nil) + suffix
return f.fn.RelString(nil)
} else {
// Bare function.
if name := f.CName(); name != "" {
// Name CGo functions directly.
return name
} else {
name := f.fn.RelString(nil) + suffix
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)