summaryrefslogtreecommitdiff
path: root/src/cmd/gc/export.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
commit7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (patch)
tree3ef530baa80cdf29436ba981f5783be6b4d2202b /src/cmd/gc/export.c
parent50104cc32a498f7517a51c8dc93106c51c7a54b4 (diff)
downloadgolang-7b15ed9ef455b6b66c6b376898a88aef5d6a9970.tar.gz
Imported Upstream version 2011.04.13upstream/2011.04.13
Diffstat (limited to 'src/cmd/gc/export.c')
-rw-r--r--src/cmd/gc/export.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c
index 09b963f27..014f0c5f0 100644
--- a/src/cmd/gc/export.c
+++ b/src/cmd/gc/export.c
@@ -75,10 +75,15 @@ autoexport(Node *n, int ctxt)
static void
dumppkg(Pkg *p)
{
+ char *suffix;
+
if(p == nil || p == localpkg || p->exported)
return;
p->exported = 1;
- Bprint(bout, "\timport %s \"%Z\"\n", p->name, p->path);
+ suffix = "";
+ if(!p->direct)
+ suffix = " // indirect";
+ Bprint(bout, "\timport %s \"%Z\"%s\n", p->name, p->path, suffix);
}
static void
@@ -265,7 +270,8 @@ void
dumpexport(void)
{
NodeList *l;
- int32 lno;
+ int32 i, lno;
+ Pkg *p;
lno = lineno;
@@ -277,6 +283,11 @@ dumpexport(void)
Bprint(bout, " safe");
Bprint(bout, "\n");
+ for(i=0; i<nelem(phash); i++)
+ for(p=phash[i]; p; p=p->link)
+ if(p->direct)
+ dumppkg(p);
+
for(l=exportlist; l; l=l->next) {
lineno = l->n->lineno;
dumpsym(l->n->sym);