summaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/import.cc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-17 23:21:08 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-17 23:21:08 +0000
commit18d835b908fb5df56ebecc99038e2fa0e35cb03e (patch)
tree8d741a435b92dd40a98b3a05ddacc3d2b3c78639 /gcc/go/gofrontend/import.cc
parent688835310af1344ab6590e18cac8c09ac2e54093 (diff)
downloadgcc-18d835b908fb5df56ebecc99038e2fa0e35cb03e.tar.gz
compiler: List imported packages in export information.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184355 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/import.cc')
-rw-r--r--gcc/go/gofrontend/import.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc
index 6cecf19f70b..58b0355c6c6 100644
--- a/gcc/go/gofrontend/import.cc
+++ b/gcc/go/gofrontend/import.cc
@@ -304,7 +304,10 @@ Import::import(Gogo* gogo, const std::string& local_name,
this->package_->set_priority(prio);
this->require_c_string(";\n");
- if (stream->match_c_string("import "))
+ while (stream->match_c_string("import"))
+ this->read_one_import();
+
+ if (stream->match_c_string("init"))
this->read_import_init_fns(gogo);
// Loop over all the input data for this package.
@@ -344,12 +347,24 @@ Import::import(Gogo* gogo, const std::string& local_name,
return this->package_;
}
+// Read an import line. We don't actually care about these.
+
+void
+Import::read_one_import()
+{
+ this->require_c_string("import ");
+ Stream* stream = this->stream_;
+ while (stream->peek_char() != ';')
+ stream->advance(1);
+ this->require_c_string(";\n");
+}
+
// Read the list of import control functions.
void
Import::read_import_init_fns(Gogo* gogo)
{
- this->require_c_string("import");
+ this->require_c_string("init");
while (!this->match_c_string(";"))
{
this->require_c_string(" ");