diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/cmd/6a/a.y | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-51f2ca399fb8da86b2e7b3a0582e083fab731a98.tar.gz |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/cmd/6a/a.y')
-rw-r--r-- | src/cmd/6a/a.y | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/cmd/6a/a.y b/src/cmd/6a/a.y index ed72916b2..6fd491067 100644 --- a/src/cmd/6a/a.y +++ b/src/cmd/6a/a.y @@ -40,8 +40,8 @@ vlong lval; double dval; char sval[8]; - Gen gen; - Gen2 gen2; + Addr addr; + Addr2 addr2; } %left '|' %left '^' @@ -58,10 +58,10 @@ %token <sval> LSCONST LSP %token <sym> LNAME LLAB LVAR %type <lval> con con2 expr pointer offset -%type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem -%type <gen2> nonnon nonrel nonrem rimnon rimrem remrim -%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 -%type <gen2> spec10 spec11 spec12 spec13 +%type <addr> mem imm imm2 reg nam rel rem rim rom omem nmem +%type <addr2> nonnon nonrel nonrem rimnon rimrem remrim +%type <addr2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 +%type <addr2> spec10 spec11 spec12 spec13 %% prog: | prog @@ -367,14 +367,12 @@ rel: if(pass == 2) yyerror("undefined label: %s", $1->name); $$.type = D_BRANCH; - $$.sym = $1; $$.offset = $2; } | LLAB offset { $$ = nullgen; $$.type = D_BRANCH; - $$.sym = $1; $$.offset = $1->value + $2; } @@ -444,31 +442,31 @@ imm: { $$ = nullgen; $$.type = D_SCONST; - memcpy($$.sval, $2, sizeof($$.sval)); + memcpy($$.u.sval, $2, sizeof($$.u.sval)); } | '$' LFCONST { $$ = nullgen; $$.type = D_FCONST; - $$.dval = $2; + $$.u.dval = $2; } | '$' '(' LFCONST ')' { $$ = nullgen; $$.type = D_FCONST; - $$.dval = $3; + $$.u.dval = $3; } | '$' '(' '-' LFCONST ')' { $$ = nullgen; $$.type = D_FCONST; - $$.dval = -$4; + $$.u.dval = -$4; } | '$' '-' LFCONST { $$ = nullgen; $$.type = D_FCONST; - $$.dval = -$3; + $$.u.dval = -$3; } mem: @@ -572,14 +570,14 @@ nam: { $$ = nullgen; $$.type = $4; - $$.sym = $1; + $$.sym = linklookup(ctxt, $1->name, 0); $$.offset = $2; } | LNAME '<' '>' offset '(' LSB ')' { $$ = nullgen; $$.type = D_STATIC; - $$.sym = $1; + $$.sym = linklookup(ctxt, $1->name, 1); $$.offset = $4; } |