diff options
author | Austin Clements <austin@google.com> | 2018-11-01 12:20:28 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-11-12 20:46:50 +0000 |
commit | 16e6cd9a4dc499db164624a048f25e2f382ac016 (patch) | |
tree | fcf2eb5fcc0c780d3ad55fab972048915c52d863 /src/cmd/compile/internal/types/sym.go | |
parent | c5718b6b261a66aa47312037f17281d3d810c98c (diff) | |
download | go-16e6cd9a4dc499db164624a048f25e2f382ac016.tar.gz go-16e6cd9a4dc499db164624a048f25e2f382ac016.zip |
cmd/compile: mark function Syms
In order to mark the obj.LSyms produced by the compiler with the
correct ABI, we need to know which types.Syms refer to function
symbols. This CL adds a flag to types.Syms to mark symbols for
functions, and sets this flag everywhere we create a PFUNC-class node,
and in the one place where we directly create function symbols without
always wrapping them in a PFUNC node (methodSym).
We'll use this information to construct obj.LSyms with correct ABI
information.
For #27539.
Change-Id: Ie3ac8bf3da013e449e78f6ca85546a055f275463
Reviewed-on: https://go-review.googlesource.com/c/147158
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types/sym.go')
-rw-r--r-- | src/cmd/compile/internal/types/sym.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index b7fd7ae9fb..28583378d9 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -42,6 +42,7 @@ const ( symSiggen // type symbol has been generated symAsm // on asmlist, for writing to -asmhdr symAlgGen // algorithm table has been generated + symFunc // function symbol; uses internal ABI ) func (sym *Sym) OnExportList() bool { return sym.flags&symOnExportList != 0 } @@ -49,12 +50,14 @@ func (sym *Sym) Uniq() bool { return sym.flags&symUniq != 0 } func (sym *Sym) Siggen() bool { return sym.flags&symSiggen != 0 } func (sym *Sym) Asm() bool { return sym.flags&symAsm != 0 } func (sym *Sym) AlgGen() bool { return sym.flags&symAlgGen != 0 } +func (sym *Sym) Func() bool { return sym.flags&symFunc != 0 } func (sym *Sym) SetOnExportList(b bool) { sym.flags.set(symOnExportList, b) } func (sym *Sym) SetUniq(b bool) { sym.flags.set(symUniq, b) } func (sym *Sym) SetSiggen(b bool) { sym.flags.set(symSiggen, b) } func (sym *Sym) SetAsm(b bool) { sym.flags.set(symAsm, b) } func (sym *Sym) SetAlgGen(b bool) { sym.flags.set(symAlgGen, b) } +func (sym *Sym) SetFunc(b bool) { sym.flags.set(symFunc, b) } func (sym *Sym) IsBlank() bool { return sym != nil && sym.Name == "_" |