]> Cypherpunks repositories - gostls13.git/commitdiff
6a, 6c, 6l: fix for Plan 9 build
authorLucio De Re <lucio.dere@gmail.com>
Fri, 15 Jul 2011 15:58:39 +0000 (11:58 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 15 Jul 2011 15:58:39 +0000 (11:58 -0400)
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

src/cmd/6a/a.h
src/cmd/6a/a.y
src/cmd/6a/lex.c
src/cmd/6c/gc.h
src/cmd/6c/swt.c
src/cmd/6l/Makefile
src/cmd/6l/l.h
src/cmd/6l/obj.c
src/cmd/6l/pass.c
src/cmd/6l/prof.c
src/cmd/6l/span.c

index 2d42726465e645f942249a28d39372193e76a845..5c7868070c4e14550aa2e76cd9693456366b9f73 100644 (file)
@@ -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
index 770f676fe5a56fdcee73926959b638782c0da874..c0fa4106e7bdfce0ede52c04e6c58e8f1b849001 100644 (file)
@@ -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 {
index 784241bde5c6dbc4f5152ee3fc217f7ce71b0d3c..5009a7b832f4c387513be664ec23f6af323fa893 100644 (file)
 // THE SOFTWARE.
 
 #define        EXTERN
+#include <u.h>
+#include <libc.h>
 #include "a.h"
 #include "y.tab.h"
-#include <ctype.h>
 
 enum
 {
index 775d97281cc65e5904669d109dff6ec5e5894e90..0c23b115cd3b247049a4f1054f007fd7995ac9d3 100644 (file)
@@ -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*
index 6d886f4592746d5f61bd1afc88c6ef12e2b6d624..d7a917043eb0f6767a1112a92be149a648375a02 100644 (file)
@@ -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");
index abe204d4f5a8b589802cda709db5cb2d1b1194b5..8ed3e1411afa766acdca95f160b04670b7fdeb64 100644 (file)
@@ -30,7 +30,7 @@ OFILES=\
 
 HFILES=\
        l.h\
-       ../6l/6.out.h\
+       6.out.h\
        ../ld/lib.h\
        ../ld/elf.h\
        ../ld/macho.h\
index c3f5949ed8efeada0aeb7c7c6d285851ea9b3643..ecdb5777b83b79d3edb4704b9a15115fb3c47d83 100644 (file)
@@ -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;
index 71649473d2f0720e5547c7ebcccfb99d4719c683..d6467a51334a26ee18e2a42df3996551eb7fedf6 100644 (file)
@@ -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);
index 0b0ee1253cd0c9db99f1190bedba32f84b398684..773a30e4aba30ffb04c458859a97e751388f858b 100644 (file)
@@ -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) {
index 25992a40bad41d312cba01708ef996ef2dc2136f..862ce080cdfd1afde95df08f15257db144c5c2ca 100644 (file)
@@ -36,7 +36,7 @@
 void
 doprof1(void)
 {
-#if 0
+#ifdef NOTDEF
        Sym *s;
        int32 n;
        Prog *p, *q;
index 426db255d96ee1354c9e92c972b8e33eaf7d805d..5d13ad44b265a0653f1b91f6c79893fe11da4b47 100644 (file)
@@ -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);