diff options
author | Russ Cox <rsc@golang.org> | 2010-01-24 22:36:26 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-01-24 22:36:26 -0800 |
commit | dbe966e01a715eafbc0910dd2733f382bdb517a8 (patch) | |
tree | 9799d2da0378114d900b4256c23a4cef20b69218 | |
parent | 47d75213f491ac6111bae718b6f22c91dddb8c75 (diff) | |
download | golang-dbe966e01a715eafbc0910dd2733f382bdb517a8.tar.gz |
gc: cut some dead code, fix 6g -S output
R=ken2
CC=golang-dev
http://codereview.appspot.com/193079
-rw-r--r-- | src/cmd/gc/export.c | 51 | ||||
-rw-r--r-- | src/cmd/gc/go.h | 1 | ||||
-rw-r--r-- | src/cmd/gc/go.y | 1 | ||||
-rw-r--r-- | src/cmd/gc/lex.c | 12 |
4 files changed, 11 insertions, 54 deletions
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c index 16e609795..ec1c135d8 100644 --- a/src/cmd/gc/export.c +++ b/src/cmd/gc/export.c @@ -384,54 +384,3 @@ importmethod(Sym *s, Type *t) addmethod(s, t, 0); } -/* - * ******* import ******* - */ - -void -checkimports(void) -{ - Sym *s; - Type *t, *t1; - uint32 h; - int et; - -return; - - for(h=0; h<NHASH; h++) - for(s = hash[h]; s != S; s = s->link) { - if(s->def == N || s->def->op != OTYPE) - continue; - t = s->def->type; - if(t == T) - continue; - - et = t->etype; - switch(t->etype) { - case TFORW: - print("ci-1: %S %lT\n", s, t); - break; - - case TPTR32: - case TPTR64: - if(t->type == T) { - print("ci-2: %S %lT\n", s, t); - break; - } - - t1 = t->type; - if(t1 == T) { - print("ci-3: %S %lT\n", s, t1); - break; - } - - et = t1->etype; - if(et == TFORW) { - print("%L: ci-4: %S %lT\n", lineno, s, t); - break; - } - break; - } - } -} - diff --git a/src/cmd/gc/go.h b/src/cmd/gc/go.h index cb0b1a119..ac9e5c6f3 100644 --- a/src/cmd/gc/go.h +++ b/src/cmd/gc/go.h @@ -1025,7 +1025,6 @@ void importconst(Sym *s, Type *t, Node *v); void importmethod(Sym *s, Type *t); void importtype(Type *s, Type *t); void importvar(Sym *s, Type *t, int ctxt); -void checkimports(void); Type* pkgtype(Sym*); Sym* importsym(Sym*, int); diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index bc543d5e3..8882f7f2e 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -253,7 +253,6 @@ import_there: hidden_import_list '$' '$' { resumecheckwidth(); - checkimports(); unimportfile(); } diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index efbb11631..03f5b473c 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -27,12 +27,22 @@ main(int argc, char *argv[]) localpkg->prefix = "\"\""; builtinpkg = mkpkg(strlit("go.builtin")); + gostringpkg = mkpkg(strlit("go.string")); - gostringpkg->prefix = "go.string"; + gostringpkg->name = "go.string"; + gostringpkg->prefix = "go.string"; // not go%2estring + runtimepkg = mkpkg(strlit("runtime")); + runtimepkg->name = "runtime"; + stringpkg = mkpkg(strlit("string")); + stringpkg->name = "string"; + typepkg = mkpkg(strlit("type")); + typepkg->name = "type"; + unsafepkg = mkpkg(strlit("unsafe")); + unsafepkg->name = "unsafe"; goroot = getgoroot(); goos = getgoos(); |