compiler: relocate ID encoding utilities to gofrontend
commit438b4becd1addc67e357ae4dbae1747416fb1ebf
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Nov 2016 22:28:05 +0000 (22 22:28 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Nov 2016 22:28:05 +0000 (22 22:28 +0000)
tree3f3e5efdd02fec9f6bb7a55785fb00da33b93a4a
parentdf8ade88e8a430b9fce5710f17187bdb248e8839
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242726 138bc75d-0d04-0410-961f-82ee72b054a4
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