diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-18 23:22:01 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-18 23:22:01 +0000 |
commit | dbf9376f9ed37bc98218adde4e17d6ee34701179 (patch) | |
tree | ae9ca18100b4d161827eb0d62c561c73d7e8625b /gcc/go/gofrontend/export.h | |
parent | 442d4185084653cec6922fc87f9a8c1b96e4b87d (diff) | |
download | gcc-dbf9376f9ed37bc98218adde4e17d6ee34701179.zip gcc-dbf9376f9ed37bc98218adde4e17d6ee34701179.tar.gz gcc-dbf9376f9ed37bc98218adde4e17d6ee34701179.tar.bz2 |
compiler: list indirect imports separately in export data
Previously when export data referred to a type that was not defined in
a directly imported package, we would write the package name as
additional information in the type's export data. That approach
required all type information to be read in order. This patch changes
the compiler to find all references to indirectly imported packages,
and write them out as an indirectimport line in the import data. This
will permit us to read exported type data out of order.
The type traversal used to find indirect imports is a little more
complicated than necessary in preparation for later patches in this
series.
Reviewed-on: https://go-review.googlesource.com/c/143020
From-SVN: r265296
Diffstat (limited to 'gcc/go/gofrontend/export.h')
-rw-r--r-- | gcc/go/gofrontend/export.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/export.h b/gcc/go/gofrontend/export.h index b08bf85..5594281 100644 --- a/gcc/go/gofrontend/export.h +++ b/gcc/go/gofrontend/export.h @@ -12,6 +12,7 @@ class Go_sha1_helper; class Gogo; class Import_init; +class Named_object; class Bindings; class Type; class Package; @@ -194,6 +195,11 @@ class Export : public String_dump Export(const Export&); Export& operator=(const Export&); + // Prepare types for exporting. + void + prepare_types(const std::vector<Named_object*>* exports, + Unordered_set(const Package*)* imports); + // Write out all known packages. void write_packages(const std::map<std::string, Package*>& packages); @@ -210,7 +216,8 @@ class Export : public String_dump // Write out the imported packages. void - write_imports(const std::map<std::string, Package*>& imports); + write_imports(const std::map<std::string, Package*>& imports, + const Unordered_set(const Package*)& type_imports); // Write out the imported initialization functions and init graph. void |