mirror of
https://github.com/golang/go
synced 2024-11-20 06:54:42 -07:00
6a, 6c, 6l: fix for Plan 9 build
6a/a.h: . Dropped <u.h> and <libc.h>. . Made definition of EOF conditional. 6a/a.y: . Added <u.h> and <libc.h>. 6a/lex.c: . Added <u.h> and <libc.h>. . Dropped <ctype.h> (now in <u.h>). 6c/gc.h: . Added varargck pragma for "lD". 6c/swt.c: . Dropped unused "thestring" argument in Bprint() calls. 6l/Makefile: . Dropped unneeded directory prefix. 6l/l.h: . Dropped unneeded directory prefix. . Added varargck pragma for "I" and "i". 6l/obj.c: . Dropped unneeded assignment. . Dropped unreachable goto statement. 6l/pass.c: . Dropped assignments flagged as unused. 6l/prof.c: . Replaced "#if 0" with "#ifdef NOTDEF". 6l/span.c: . Dropped unused incrementation. . Added USED() as required. . Dropped unreachable "return" statement. R=golang-dev CC=golang-dev, rsc https://golang.org/cl/4747044
This commit is contained in:
parent
5ea4d73b17
commit
4c6280b0f1
@ -28,8 +28,6 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "../6l/6.out.h"
|
||||
|
||||
@ -57,7 +55,9 @@ typedef struct Gen2 Gen2;
|
||||
#define NSYMB 500
|
||||
#define BUFSIZ 8192
|
||||
#define HISTSZ 20
|
||||
#ifndef EOF
|
||||
#define EOF (-1)
|
||||
#endif
|
||||
#define IGN (-2)
|
||||
#define GETC() ((--fi.c < 0)? filbuf(): *fi.p++ & 0xff)
|
||||
#define NHASH 503
|
||||
|
@ -29,7 +29,9 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
%{
|
||||
#include <u.h>
|
||||
#include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */
|
||||
#include <libc.h>
|
||||
#include "a.h"
|
||||
%}
|
||||
%union {
|
||||
|
@ -29,9 +29,10 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#define EXTERN
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include "a.h"
|
||||
#include "y.tab.h"
|
||||
#include <ctype.h>
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -398,6 +398,7 @@ void shiftit(Type*, Node*, Node*);
|
||||
#pragma varargck type "A" int
|
||||
#pragma varargck type "B" Bits
|
||||
#pragma varargck type "D" Adr*
|
||||
#pragma varargck type "lD" Adr*
|
||||
#pragma varargck type "P" Prog*
|
||||
#pragma varargck type "R" int
|
||||
#pragma varargck type "S" char*
|
||||
|
@ -238,10 +238,10 @@ outcode(void)
|
||||
Bprint(&b, "\n");
|
||||
Bprint(&b, "$$ // exports\n\n");
|
||||
Bprint(&b, "$$ // local types\n\n");
|
||||
Bprint(&b, "$$ // dynimport\n", thestring);
|
||||
Bprint(&b, "$$ // dynimport\n");
|
||||
for(i=0; i<ndynimp; i++)
|
||||
Bprint(&b, "dynimport %s %s %s\n", dynimp[i].local, dynimp[i].remote, dynimp[i].path);
|
||||
Bprint(&b, "\n$$ // dynexport\n", thestring);
|
||||
Bprint(&b, "\n$$ // dynexport\n");
|
||||
for(i=0; i<ndynexp; i++)
|
||||
Bprint(&b, "dynexport %s %s\n", dynexp[i].local, dynexp[i].remote);
|
||||
Bprint(&b, "\n$$\n\n");
|
||||
|
@ -30,7 +30,7 @@ OFILES=\
|
||||
|
||||
HFILES=\
|
||||
l.h\
|
||||
../6l/6.out.h\
|
||||
6.out.h\
|
||||
../ld/lib.h\
|
||||
../ld/elf.h\
|
||||
../ld/macho.h\
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "../6l/6.out.h"
|
||||
#include "6.out.h"
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN extern
|
||||
@ -301,9 +301,11 @@ EXTERN union
|
||||
|
||||
#pragma varargck type "A" uint
|
||||
#pragma varargck type "D" Adr*
|
||||
#pragma varargck type "I" uchar*
|
||||
#pragma varargck type "P" Prog*
|
||||
#pragma varargck type "R" int
|
||||
#pragma varargck type "S" char*
|
||||
#pragma varargck type "i" char*
|
||||
|
||||
EXTERN int32 HEADR;
|
||||
EXTERN int32 HEADTYPE;
|
||||
|
@ -455,7 +455,6 @@ loop:
|
||||
s = lookup(x, r);
|
||||
if(x != name)
|
||||
free(x);
|
||||
name = nil;
|
||||
|
||||
if(debug['S'] && r == 0)
|
||||
sig = 1729;
|
||||
@ -724,7 +723,6 @@ loop:
|
||||
lastp = p;
|
||||
goto loop;
|
||||
}
|
||||
goto loop;
|
||||
|
||||
eof:
|
||||
diag("truncated object file: %s", pn);
|
||||
|
@ -402,8 +402,6 @@ dostkoff(void)
|
||||
pmorestack[i] = symmorestack[i]->text;
|
||||
}
|
||||
|
||||
autoffset = 0;
|
||||
deltasp = 0;
|
||||
for(cursym = textp; cursym != nil; cursym = cursym->next) {
|
||||
if(cursym->text == nil || cursym->text->link == nil)
|
||||
continue;
|
||||
@ -415,7 +413,6 @@ dostkoff(void)
|
||||
autoffset = 0;
|
||||
|
||||
q = P;
|
||||
q1 = P;
|
||||
if((p->from.scale & NOSPLIT) && autoffset >= StackSmall)
|
||||
diag("nosplit func likely to overflow stack");
|
||||
|
||||
@ -471,7 +468,6 @@ dostkoff(void)
|
||||
p = appendp(p);
|
||||
p->as = ANOP;
|
||||
q1->pcond = p;
|
||||
q1 = P;
|
||||
}
|
||||
|
||||
if(autoffset < StackBig) { // do we need to call morestack?
|
||||
@ -611,7 +607,6 @@ dostkoff(void)
|
||||
p = appendp(p);
|
||||
p->as = ANOP;
|
||||
q1->pcond = p;
|
||||
q1 = P;
|
||||
}
|
||||
|
||||
for(; p != P; p = p->link) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
void
|
||||
doprof1(void)
|
||||
{
|
||||
#if 0
|
||||
#ifdef NOTDEF
|
||||
Sym *s;
|
||||
int32 n;
|
||||
Prog *p, *q;
|
||||
|
@ -94,7 +94,7 @@ span1(Sym *s)
|
||||
*bp++ = v;
|
||||
*bp++ = v>>8;
|
||||
*bp++ = v>>16;
|
||||
*bp++ = v>>24;
|
||||
*bp = v>>24;
|
||||
}
|
||||
}
|
||||
p->comefrom = P;
|
||||
@ -706,6 +706,7 @@ asmandsz(Adr *a, int r, int rex, int m64)
|
||||
int t, scale;
|
||||
Reloc rel;
|
||||
|
||||
USED(m64);
|
||||
rex &= (0x40 | Rxr);
|
||||
v = a->offset;
|
||||
t = a->type;
|
||||
@ -732,7 +733,6 @@ asmandsz(Adr *a, int r, int rex, int m64)
|
||||
*andptr++ = (0 << 6) | (4 << 0) | (r << 3);
|
||||
asmidx(a->scale, a->index, t);
|
||||
goto putrelv;
|
||||
return;
|
||||
}
|
||||
if(v == 0 && rel.siz == 0 && t != D_BP && t != D_R13) {
|
||||
*andptr++ = (0 << 6) | (4 << 0) | (r << 3);
|
||||
|
Loading…
Reference in New Issue
Block a user