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
// 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"
#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
// 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 {
// THE SOFTWARE.
#define EXTERN
+#include <u.h>
+#include <libc.h>
#include "a.h"
#include "y.tab.h"
-#include <ctype.h>
enum
{
#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*
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");
HFILES=\
l.h\
- ../6l/6.out.h\
+ 6.out.h\
../ld/lib.h\
../ld/elf.h\
../ld/macho.h\
#include <u.h>
#include <libc.h>
#include <bio.h>
-#include "../6l/6.out.h"
+#include "6.out.h"
#ifndef EXTERN
#define EXTERN extern
#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;
s = lookup(x, r);
if(x != name)
free(x);
- name = nil;
if(debug['S'] && r == 0)
sig = 1729;
lastp = p;
goto loop;
}
- goto loop;
eof:
diag("truncated object file: %s", pn);
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;
autoffset = 0;
q = P;
- q1 = P;
if((p->from.scale & NOSPLIT) && autoffset >= StackSmall)
diag("nosplit func likely to overflow stack");
p = appendp(p);
p->as = ANOP;
q1->pcond = p;
- q1 = P;
}
if(autoffset < StackBig) { // do we need to call morestack?
p = appendp(p);
p->as = ANOP;
q1->pcond = p;
- q1 = P;
}
for(; p != P; p = p->link) {
void
doprof1(void)
{
-#if 0
+#ifdef NOTDEF
Sym *s;
int32 n;
Prog *p, *q;
*bp++ = v;
*bp++ = v>>8;
*bp++ = v>>16;
- *bp++ = v>>24;
+ *bp = v>>24;
}
}
p->comefrom = P;
int t, scale;
Reloc rel;
+ USED(m64);
rex &= (0x40 | Rxr);
v = a->offset;
t = a->type;
*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);