]> git.ipfire.org Git - thirdparty/gcc.git/commit
reflect: canonicalize types returned by StructOf() and friends
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 5 Jun 2018 20:23:40 +0000 (20:23 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 5 Jun 2018 20:23:40 +0000 (20:23 +0000)
commite0b195b58aaa99cbdcb2bbe2996f6885562da987
tree20115a17b149bdd5fa407deec538f86505eadb6d
parent6d02e2d96029dfddfc4a37cd82791503f5a1fd88
reflect: canonicalize types returned by StructOf() and friends

    Background: since gccgo does not currently merge identical types at link time,
    the reflect function canonicalize() exists to choose a canonical specimen
    for each set of identical types.
    In this way, user code has the guarantee that identical types
    will always compare as ==

    Change: arrange reflect functions MapOf(), SliceOf(), StructOf() etc.
    to call canonicalize() on the types they create, before storing the types
    in internal lookup caches and returning them.

    This fixes known cases where canonicalize() is needed but was missing.
    Supersedes https://golang.org/cl/112575 and mostly fixes issue 25284.

    Updates golang/go#25284

    Reviewed-on: https://go-review.googlesource.com/115577

From-SVN: r261216
gcc/go/gofrontend/MERGE
libgo/go/reflect/all_test.go
libgo/go/reflect/type.go