aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/go-encode-id.h
AgeCommit message (Collapse)AuthorFilesLines
2018-01-24compiler: rationalize external symbol namesIan Lance Taylor1-6/+8
Encode all external symbol names using only ASCII alphanumeric characters, underscore, and dot. Use a scheme that can be reliably demangled to a somewhat readable version as described in the long comment in names.cc. A minor cleanup discovered during this was that we were treating function types as different if one had a NULL parameters_ field and another has a non-NULL parameters_ field that has no parameters. This worked because we mangled them slightly differently. We now mangle them the same, so we treat them as equal, as we should anyhow. Reviewed-on: https://go-review.googlesource.com/89555 * go.go-torture/execute/names-1.go: New test. From-SVN: r257033
2016-11-22compiler: relocate ID encoding utilities to gofrontendThan McIntosh1-0/+30
Relocate the code that encodes/sanitizes identifiers to make them assembler-friendly, moving it from the back end to the front end; the decisions about when to encode an identifier and the calls to the encoding helpers now take place entirely in gofrontend. Reviewed-on: https://go-review.googlesource.com/33424 * go-gcc.cc (char_needs_encoding): Remove. (needs_encoding, fetch_utf8_char, encode_id): Remove. (Gcc_backend::global_variable): Add asm_name parameter. Don't compute asm_name here. (Gcc_backend::implicit_variable): Likewise. (Gcc_backend::implicit_variable_reference): Likewise. (Gcc_backend::immutable_struct): Likewise. (Gcc_backend::immutable_struct_reference): Likewise. * Make-lang.in (GO_OBJS): Add go/go-encode-id.o. From-SVN: r242726