compiler: encode user visible names if necessary

Avoid putting weird characters into the user visible name.
It breaks stabs in particular, and may also cause debugger problems.
Instead, encode those names, and use a "g." prefix to tell the debugger.

Also dereference the type for the name of a recover thunk, to avoid a
pointless '*' that gets encoded.

Change-Id: Ie469be9b25806b220107eae4981a3d9a4a92bade
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/277232
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 files changed