compiler: relocate ID encoding utilities to gofrontend
authorThan McIntosh <thanm@google.com>
Tue, 22 Nov 2016 22:28:05 +0000 (22:28 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 22 Nov 2016 22:28:05 +0000 (22:28 +0000)
commitf3878205ddc2970e384ffaed3a95362763eee9fe
tree3f3e5efdd02fec9f6bb7a55785fb00da33b93a4a
parent7e98cccbd85a0bc5ec6b7edf0017d98c2e96aef5
compiler: relocate ID encoding utilities to gofrontend

    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
gcc/go/ChangeLog
gcc/go/Make-lang.in
gcc/go/go-gcc.cc
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/backend.h
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/go-encode-id.cc [new file with mode: 0644]
gcc/go/gofrontend/go-encode-id.h [new file with mode: 0644]
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/types.cc