diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-29 14:58:54 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-02-03 18:22:15 +0000 |
| commit | 77a415e5a698e8f897aed8aa64db6855b8f952fc (patch) | |
| tree | a2adb923b983adfd5301f0d87c9c26949e22d9d6 /src/cmd/gc | |
| parent | 72521319c733e5de62bb837508ea9fa2b1f3a0a2 (diff) | |
| download | go-77a415e5a698e8f897aed8aa64db6855b8f952fc.tar.xz | |
liblink: place TEXT/GLOBL flags in p->from3 always
Before, amd64 and 386 stored the flags in p->from.scale
and arm and ppc64 stored the flags in p->reg.
Both caused special cases in printing and in handling of the
addresses.
To avoid possible conflicts with the real meaning of p->from
and to avoid storing a non-register value in a reg field,
use from3 to hold a TYPE_CONST value giving the flags.
There is still a special case for printing, because the flags
are specified without a $, and normally a TYPE_CONST prints
with a $. But that's much less special than what came before.
This allows us to remove the textflag and settextflag methods
from LinkArch. They are no longer architecture-specific.
Change-Id: I931da8e1ecd92e127cd9aa44ef5a73c42e730110
Reviewed-on: https://go-review.googlesource.com/3572
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/gc')
| -rw-r--r-- | src/cmd/gc/pgen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/gc/pgen.c b/src/cmd/gc/pgen.c index 99644d201f..183bd71426 100644 --- a/src/cmd/gc/pgen.c +++ b/src/cmd/gc/pgen.c @@ -231,20 +231,20 @@ compile(Node *fn) nodconst(&nod1, types[TINT32], 0); ptxt = arch.gins(arch.ATEXT, isblank(curfn->nname) ? N : curfn->nname, &nod1); if(fn->dupok) - arch.thelinkarch->settextflag(ptxt, arch.thelinkarch->textflag(ptxt) | DUPOK); + ptxt->from3.offset |= DUPOK; if(fn->wrapper) - arch.thelinkarch->settextflag(ptxt, arch.thelinkarch->textflag(ptxt) | WRAPPER); + ptxt->from3.offset |= WRAPPER; if(fn->needctxt) - arch.thelinkarch->settextflag(ptxt, arch.thelinkarch->textflag(ptxt) | NEEDCTXT); + ptxt->from3.offset |= NEEDCTXT; if(fn->nosplit) - arch.thelinkarch->settextflag(ptxt, arch.thelinkarch->textflag(ptxt) | NOSPLIT); + ptxt->from3.offset |= NOSPLIT; // Clumsy but important. // See test/recover.go for test cases and src/reflect/value.go // for the actual functions being considered. if(myimportpath != nil && strcmp(myimportpath, "reflect") == 0) { if(strcmp(curfn->nname->sym->name, "callReflect") == 0 || strcmp(curfn->nname->sym->name, "callMethod") == 0) - arch.thelinkarch->settextflag(ptxt, arch.thelinkarch->textflag(ptxt) | WRAPPER); + ptxt->from3.offset |= WRAPPER; } arch.afunclit(&ptxt->from, curfn->nname); |
