Commit 1250d2e3 authored by Russ Cox's avatar Russ Cox

cmd/gc: remove C subclassing trick from popt.c

It does not convert to Go well.

Being able to do this just once, instead of 4 times, was the primary
motivation for all the recent refactoring (not that it wasn't overdue).

Still bit-for-bit identical.

Change-Id: Ia01f17948441bf64fa78ec4226f0bb40af0bbaab
Reviewed-on: https://go-review.googlesource.com/3962Reviewed-by: default avatarAustin Clements <austin@google.com>
parent ad88fd1d
......@@ -65,7 +65,7 @@ peep(Prog *firstp)
Prog *p;
int t;
g = flowstart(firstp, sizeof(Flow));
g = flowstart(firstp, 0);
if(g == nil)
return;
gactive = 0;
......
......@@ -97,7 +97,7 @@ peep(Prog *firstp)
Prog *p, *p1;
int t;
g = flowstart(firstp, sizeof(Flow));
g = flowstart(firstp, 0);
if(g == nil)
return;
gactive = 0;
......
......@@ -94,7 +94,7 @@ peep(Prog *firstp)
Prog *p, *p1;
int t;
g = flowstart(firstp, sizeof(Flow));
g = flowstart(firstp, 0);
if(g == nil)
return;
gactive = 0;
......
......@@ -55,7 +55,7 @@ peep(Prog *firstp)
Prog *p, *p1;
int t;
g = flowstart(firstp, sizeof(Flow));
g = flowstart(firstp, 0);
if(g == nil)
return;
gactive = 0;
......
......@@ -1557,9 +1557,12 @@ struct Flow {
int32 active; // usable by client
int32 id; // sequence number in flow graph
int32 rpo; // reverse post ordering
uint16 loop; // x5 for every loop
uchar refset; // diagnostic generated
void* data; // for use by client
};
struct Graph
......
This diff is collapsed.
......@@ -68,11 +68,8 @@ uint64 STORE(Reg*);
// A Reg is a wrapper around a single Prog (one instruction) that holds
// register optimization information while the optimizer runs.
// r->prog is the instruction.
// r->prog->opt points back to r.
struct Reg
{
Flow f;
Bits set; // regopt variables written by this instruction.
Bits use1; // regopt variables read by prog->from.
Bits use2; // regopt variables read by prog->to.
......@@ -109,7 +106,7 @@ struct Reg
// cost.
struct Rgn
{
Reg* enter;
Flow* enter;
short cost;
short varno;
short regno;
......@@ -143,17 +140,7 @@ EXTERN struct
/*
* reg.c
*/
int rcmp(const void*, const void*);
void regopt(Prog*);
void addmove(Reg*, int, int, int);
Bits mkvar(Reg*, Adr*);
void prop(Reg*, Bits, Bits);
void synch(Reg*, Bits);
uint64 allreg(uint64, Rgn*);
void paint1(Reg*, int);
uint64 paint2(Reg*, int, int);
void paint3(Reg*, int, uint64, int);
void addreg(Adr*, int);
void dumpone(Flow*, int);
void dumpit(char*, Flow*, int);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment