1
0
mirror of https://github.com/golang/go synced 2024-11-26 06:57:56 -07:00

delete heuristic left over from incremental compilation

R=r
DELTA=31  (2 added, 28 deleted, 1 changed)
OCL=33064
CL=33112
This commit is contained in:
Russ Cox 2009-08-12 14:41:02 -07:00
parent b5c57fea96
commit 8db677b0a7
2 changed files with 3 additions and 29 deletions

View File

@ -692,23 +692,10 @@ addlib(char *src, char *obj)
snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name); snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name);
strcpy(name, pname); strcpy(name, pname);
} }
cleanname(name);
if(debug['v']) if(debug['v'])
Bprint(&bso, "%5.2f addlib: %s %s pulls in %s\n", cputime(), obj, src, name); Bprint(&bso, "%5.2f addlib: %s %s pulls in %s\n", cputime(), obj, src, name);
p = strrchr(src, '/');
q = strrchr(name, '/');
if(p != nil && q != nil && p - src == q - name && memcmp(src, name, p - src) == 0) {
// leading paths are the same.
// if the source file refers to an object in its own directory
// and we are inside an archive, ignore the reference, in the hope
// that the archive contains that object too.
if(strchr(obj, '(')) {
if(debug['v'])
Bprint(&bso, "%5.2f ignored srcdir object %s\n", cputime(), name);
return;
}
}
for(i=0; i<libraryp; i++) for(i=0; i<libraryp; i++)
if(strcmp(name, library[i]) == 0) if(strcmp(name, library[i]) == 0)
return; return;

View File

@ -600,7 +600,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
void void
addlib(char *src, char *obj) addlib(char *src, char *obj)
{ {
char name[1024], pname[1024], comp[256], *p, *q; char name[1024], pname[1024], comp[256], *p;
int i, search; int i, search;
if(histfrogp <= 0) if(histfrogp <= 0)
@ -657,23 +657,10 @@ addlib(char *src, char *obj)
snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name); snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name);
strcpy(name, pname); strcpy(name, pname);
} }
cleanname(name);
if(debug['v']) if(debug['v'])
Bprint(&bso, "%5.2f addlib: %s %s pulls in %s\n", cputime(), obj, src, name); Bprint(&bso, "%5.2f addlib: %s %s pulls in %s\n", cputime(), obj, src, name);
p = strrchr(src, '/');
q = strrchr(name, '/');
if(p != nil && q != nil && p - src == q - name && memcmp(src, name, p - src) == 0) {
// leading paths are the same.
// if the source file refers to an object in its own directory
// and we are inside an archive, ignore the reference, in the hope
// that the archive contains that object too.
if(strchr(obj, '(')) {
if(debug['v'])
Bprint(&bso, "%5.2f ignored srcdir object %s\n", cputime(), name);
return;
}
}
for(i=0; i<libraryp; i++) for(i=0; i<libraryp; i++)
if(strcmp(name, library[i]) == 0) if(strcmp(name, library[i]) == 0)
return; return;