compiler: include transitive imports in the type descriptor list
commita35d6e9f2176f066837387ef4916ffbd1dae0828
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 3 Jul 2019 13:23:39 +0000 (3 13:23 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 3 Jul 2019 13:23:39 +0000 (3 13:23 +0000)
treea9c23f12c4fc48f2f3bf04fa83301f4920a09362
parent6c47a87b661598cfba79925a6fdd1ebf7737bbdc
compiler: include transitive imports in the type descriptor list

    In CL 179598, we were using Gogo::packages_, when compiling the
    main package, as the list of packages of which we need to
    register the type descriptors. This is not complete. It only
    includes main's direct import and one-level indirect imports. It
    does not include all the packages transitively imported.

    To fix that, we need to track all the transitive imports. We
    have almost already done that, for init functions. However, there
    may be packages that don't need init functions but do need to
    register type descriptors. For them, we add a dummy init function
    to its export data. So when we compile the main package we will
    see all the transitive imports. The dummy init functions are not
    real functions and are not called.

    Fixes golang/go#32901.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184717

From-SVN: r273009
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/export.cc
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/names.cc