1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00

cmd/compile/internal/gc: unexport global variable Pc

Change-Id: Id2a9fc1e9e70eaf5f25ddc7476061e06abcf60e4
Reviewed-on: https://go-review.googlesource.com/30573
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Hajime Hoshi 2016-10-07 02:06:33 +09:00 committed by Matthew Dempsky
parent 33faa4ebb9
commit fc47ee2332
4 changed files with 16 additions and 16 deletions

View File

@ -1259,7 +1259,7 @@ func funccompile(n *Node) {
funcdepth = n.Func.Depth + 1
compile(n)
Curfn = nil
Pc = nil
pc = nil
funcdepth = 0
dclcontext = PEXTERN
if nerrors != 0 {

View File

@ -274,7 +274,7 @@ var writearchive bool
var Nacl bool
var Pc *obj.Prog
var pc *obj.Prog
var nodfp *Node

View File

@ -38,10 +38,10 @@ import (
func Prog(as obj.As) *obj.Prog {
var p *obj.Prog
p = Pc
Pc = Ctxt.NewProg()
Clearp(Pc)
p.Link = Pc
p = pc
pc = Ctxt.NewProg()
Clearp(pc)
p.Link = pc
if lineno == 0 && Debug['K'] != 0 {
Warn("prog: line 0")
@ -170,9 +170,9 @@ func Addrconst(a *obj.Addr, v int64) {
func newplist() *obj.Plist {
pl := obj.Linknewplist(Ctxt)
Pc = Ctxt.NewProg()
Clearp(Pc)
pl.Firstpc = Pc
pc = Ctxt.NewProg()
Clearp(pc)
pl.Firstpc = pc
return pl
}

View File

@ -4052,7 +4052,7 @@ type SSAGenState struct {
// Pc returns the current Prog.
func (s *SSAGenState) Pc() *obj.Prog {
return Pc
return pc
}
// SetLineno sets the current source line number.
@ -4077,7 +4077,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
valueProgs = make(map[*obj.Prog]*ssa.Value, f.NumValues())
blockProgs = make(map[*obj.Prog]*ssa.Block, f.NumBlocks())
f.Logf("genssa %s\n", f.Name)
blockProgs[Pc] = f.Blocks[0]
blockProgs[pc] = f.Blocks[0]
}
if Thearch.Use387 {
@ -4089,14 +4089,14 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
// Emit basic blocks
for i, b := range f.Blocks {
s.bstart[b.ID] = Pc
s.bstart[b.ID] = pc
// Emit values in block
Thearch.SSAMarkMoves(&s, b)
for _, v := range b.Values {
x := Pc
x := pc
Thearch.SSAGenValue(&s, v)
if logProgs {
for ; x != Pc; x = x.Link {
for ; x != pc; x = x.Link {
valueProgs[x] = v
}
}
@ -4110,10 +4110,10 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
// line numbers for otherwise empty blocks.
next = f.Blocks[i+1]
}
x := Pc
x := pc
Thearch.SSAGenBlock(&s, b, next)
if logProgs {
for ; x != Pc; x = x.Link {
for ; x != pc; x = x.Link {
blockProgs[x] = b
}
}