compiler: rework type and package tracking in exporter
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 3 Jul 2019 00:56:35 +0000 (00:56 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 3 Jul 2019 00:56:35 +0000 (00:56 +0000)
commit61a02d1e97aa9b2cb3c4e3e5c823d3a8a4c5834c
treeba9c904f9fe356d87ab7ee4f3f59bebc39a71d83
parent5935baf5bb52209ed2e8fa0f435e19bd4e0507db
compiler: rework type and package tracking in exporter

    Revamps the way the exporter tracks exported types and imported
    packages that need to be mentioned in the export data.

    The previous implementation wasn't properly handling the case where an
    exported non-inlinable function refers to an imported type whose
    method set includes an inlinable function whose body makes a call to a
    function in another package that's not directly used in the original
    package.

    This patch integrates together two existing traversal helper classes,
    "Collect_references_from_inline" and "Find_types_to_prepare" into a
    single helper "Collect_export_references", so as to have common/shared
    code that looks for indirectly imported packages.

    Fixes golang/go#32778

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

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