• Dmitry Vyukov's avatar
    cmd/gc: generate simpler names for closures · 3a0fbfab
    Dmitry Vyukov authored
    Fixes #8291
    
    There were several complaints about closure names in the issue tracker.
    The first problem is that you see names like net/http.func·001
    in profiles, traces, etc. And there is no way to figure out what
    is that function.
    Another issue is non-US-ascii symbols. All programs out there
    should accept UTF-8. But unfortunately it is not true in reality.
    For example, less does not render middle dot properly.
    
    This change prepends outer function name to closure name and
    replaces middle dot with dot. Now names look like:
    
    main.glob.func1
    main.glob.func2
    main.glob.func2.1
    main.init.1
    main.init.1.func1
    main.init.1.func1.1
    main.main.func1
    main.main.func1.1
    
    Change-Id: I725726af88f2ad3ced2e3450f0f06bf459fd91c0
    Reviewed-on: https://go-review.googlesource.com/3964Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    3a0fbfab
go.h 40.9 KB