summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-09-02 12:08:52 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2022-10-03 10:41:30 +0200
commit70f297bab7ae5d7291040b0305281a5fa8289f80 (patch)
tree85305108a954e2c21f16c3e529cf5fab7a189a77
parent79f3673d205617ac567f0566ebf8f450932d9976 (diff)
downloadroux-70f297bab7ae5d7291040b0305281a5fa8289f80.tar.gz
fix case of Pool constants
-rw-r--r--all.h4
-rw-r--r--amd64/sysv.c4
-rw-r--r--arm64/abi.c4
-rw-r--r--cfg.c2
-rw-r--r--copy.c2
-rw-r--r--fold.c2
-rw-r--r--load.c8
-rw-r--r--parse.c16
-rw-r--r--ssa.c6
-rw-r--r--util.c6
10 files changed, 27 insertions, 27 deletions
diff --git a/all.h b/all.h
index 04050d4..0d0bee6 100644
--- a/all.h
+++ b/all.h
@@ -419,8 +419,8 @@ extern char debug['Z'+1];
 
 /* util.c */
 typedef enum {
-	Pheap, /* free() necessary */
-	Pfn, /* discarded after processing the function */
+	PHeap, /* free() necessary */
+	PFn, /* discarded after processing the function */
 } Pool;
 
 extern Typ *typ;
diff --git a/amd64/sysv.c b/amd64/sysv.c
index e9f3d6b..f4e0416 100644
--- a/amd64/sysv.c
+++ b/amd64/sysv.c
@@ -608,8 +608,8 @@ selvaarg(Fn *fn, Blk *b, Ins *i)
 	*b0->phi = (Phi){
 		.cls = Kl, .to = loc,
 		.narg = 2,
-		.blk = vnew(2, sizeof b0->phi->blk[0], Pfn),
-		.arg = vnew(2, sizeof b0->phi->arg[0], Pfn),
+		.blk = vnew(2, sizeof b0->phi->blk[0], PFn),
+		.arg = vnew(2, sizeof b0->phi->arg[0], PFn),
 	};
 	b0->phi->blk[0] = bstk;
 	b0->phi->blk[1] = breg;
diff --git a/arm64/abi.c b/arm64/abi.c
index 945a676..d9c3fe1 100644
--- a/arm64/abi.c
+++ b/arm64/abi.c
@@ -659,8 +659,8 @@ arm64_selvaarg(Fn *fn, Blk *b, Ins *i)
 	*b0->phi = (Phi){
 		.cls = Kl, .to = loc,
 		.narg = 2,
-		.blk = vnew(2, sizeof b0->phi->blk[0], Pfn),
-		.arg = vnew(2, sizeof b0->phi->arg[0], Pfn),
+		.blk = vnew(2, sizeof b0->phi->blk[0], PFn),
+		.arg = vnew(2, sizeof b0->phi->arg[0], PFn),
 	};
 	b0->phi->blk[0] = bstk;
 	b0->phi->blk[1] = breg;
diff --git a/cfg.c b/cfg.c
index 36e6427..d12f6c8 100644
--- a/cfg.c
+++ b/cfg.c
@@ -209,7 +209,7 @@ addfron(Blk *a, Blk *b)
 		if (a->fron[n] == b)
 			return;
 	if (!a->nfron)
-		a->fron = vnew(++a->nfron, sizeof a->fron[0], Pfn);
+		a->fron = vnew(++a->nfron, sizeof a->fron[0], PFn);
 	else
 		vgrow(&a->fron, ++a->nfron);
 	a->fron[a->nfron-1] = b;
diff --git a/copy.c b/copy.c
index 593ce24..868d2ba 100644
--- a/copy.c
+++ b/copy.c
@@ -141,7 +141,7 @@ copy(Fn *fn)
 	bsinit(ts, fn->ntmp);
 	bsinit(as, fn->ntmp);
 	cpy = emalloc(fn->ntmp * sizeof cpy[0]);
-	stk = vnew(10, sizeof stk[0], Pheap);
+	stk = vnew(10, sizeof stk[0], PHeap);
 
 	/* 1. build the copy-of map */
 	for (n=0; n<fn->nblk; n++) {
diff --git a/fold.c b/fold.c
index 3f72155..24b09a6 100644
--- a/fold.c
+++ b/fold.c
@@ -193,7 +193,7 @@ fold(Fn *fn)
 
 	val = emalloc(fn->ntmp * sizeof val[0]);
 	edge = emalloc(fn->nblk * sizeof edge[0]);
-	usewrk = vnew(0, sizeof usewrk[0], Pheap);
+	usewrk = vnew(0, sizeof usewrk[0], PHeap);
 
 	for (t=0; t<fn->ntmp; t++)
 		val[t] = Top;
diff --git a/load.c b/load.c
index 2e10a35..6c1494a 100644
--- a/load.c
+++ b/load.c
@@ -332,8 +332,8 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il)
 	p->to = r;
 	p->cls = sl.cls;
 	p->narg = b->npred;
-	p->arg = vnew(p->narg, sizeof p->arg[0], Pfn);
-	p->blk = vnew(p->narg, sizeof p->blk[0], Pfn);
+	p->arg = vnew(p->narg, sizeof p->arg[0], PFn);
+	p->blk = vnew(p->narg, sizeof p->blk[0], PFn);
 	for (np=0; np<b->npred; ++np) {
 		bp = b->pred[np];
 		if (!bp->s2
@@ -389,7 +389,7 @@ loadopt(Fn *fn)
 	Loc l;
 
 	curf = fn;
-	ilog = vnew(0, sizeof ilog[0], Pheap);
+	ilog = vnew(0, sizeof ilog[0], PHeap);
 	nlog = 0;
 	inum = 0;
 	for (b=fn->start; b; b=b->link)
@@ -404,7 +404,7 @@ loadopt(Fn *fn)
 	qsort(ilog, nlog, sizeof ilog[0], icmp);
 	vgrow(&ilog, nlog+1);
 	ilog[nlog].bid = fn->nblk; /* add a sentinel */
-	ib = vnew(0, sizeof(Ins), Pheap);
+	ib = vnew(0, sizeof(Ins), PHeap);
 	for (ist=ilog, n=0; n<fn->nblk; ++n) {
 		b = fn->rpo[n];
 		for (; ist->bid == n && ist->isphi; ++ist) {
diff --git a/parse.c b/parse.c
index e5ceca8..583388b 100644
--- a/parse.c
+++ b/parse.c
@@ -277,7 +277,7 @@ lex()
 	if (c == '"') {
 		t = Tstr;
 	Quoted:
-		tokval.str = vnew(2, 1, Pfn);
+		tokval.str = vnew(2, 1, PFn);
 		tokval.str[0] = c;
 		esc = 0;
 		for (i=1;; i++) {
@@ -711,9 +711,9 @@ Ins:
 		phi = alloc(sizeof *phi);
 		phi->to = r;
 		phi->cls = k;
-		phi->arg = vnew(i, sizeof arg[0], Pfn);
+		phi->arg = vnew(i, sizeof arg[0], PFn);
 		memcpy(phi->arg, arg, i * sizeof arg[0]);
-		phi->blk = vnew(i, sizeof blk[0], Pfn);
+		phi->blk = vnew(i, sizeof blk[0], PFn);
 		memcpy(phi->blk, blk, i * sizeof blk[0]);
 		phi->narg = i;
 		*plink = phi;
@@ -833,8 +833,8 @@ parsefn(Lnk *lnk)
 	curf = alloc(sizeof *curf);
 	curf->ntmp = 0;
 	curf->ncon = 1; /* first constant must be 0 */
-	curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], Pfn);
-	curf->con = vnew(curf->ncon, sizeof curf->con[0], Pfn);
+	curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], PFn);
+	curf->con = vnew(curf->ncon, sizeof curf->con[0], PFn);
 	for (i=0; i<Tmp0; ++i)
 		if (T.fpr0 <= i && i < T.fpr0 + T.nfpr)
 			newtmp(0, Kd, curf);
@@ -862,7 +862,7 @@ parsefn(Lnk *lnk)
 		err("empty function");
 	if (curb->jmp.type == Jxxx)
 		err("last block misses jump");
-	curf->mem = vnew(0, sizeof curf->mem[0], Pfn);
+	curf->mem = vnew(0, sizeof curf->mem[0], PFn);
 	curf->nmem = 0;
 	curf->nblk = nblk;
 	curf->rpo = 0;
@@ -983,7 +983,7 @@ parsetyp()
 		return;
 	}
 	n = 0;
-	ty->fields = vnew(1, sizeof ty->fields[0], Pheap);
+	ty->fields = vnew(1, sizeof ty->fields[0], PHeap);
 	if (t == Tlbrace) {
 		ty->isunion = 1;
 		do {
@@ -1131,7 +1131,7 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *))
 	lnum = 1;
 	thead = Txxx;
 	ntyp = 0;
-	typ = vnew(0, sizeof typ[0], Pheap);
+	typ = vnew(0, sizeof typ[0], PHeap);
 	for (;;) {
 		lnk = (Lnk){0};
 		switch (parselnk(&lnk)) {
diff --git a/ssa.c b/ssa.c
index 126113d..f3e9b45 100644
--- a/ssa.c
+++ b/ssa.c
@@ -54,7 +54,7 @@ filluse(Fn *fn)
 		tmp[t].phi = 0;
 		tmp[t].width = WFull;
 		if (tmp[t].use == 0)
-			tmp[t].use = vnew(0, sizeof(Use), Pfn);
+			tmp[t].use = vnew(0, sizeof(Use), PFn);
 	}
 	for (b=fn->start; b; b=b->link) {
 		for (p=b->phi; p; p=p->link) {
@@ -183,8 +183,8 @@ phiins(Fn *fn)
 					p->cls = k;
 					p->to = TMP(t);
 					p->link = a->phi;
-					p->arg = vnew(0, sizeof p->arg[0], Pfn);
-					p->blk = vnew(0, sizeof p->blk[0], Pfn);
+					p->arg = vnew(0, sizeof p->arg[0], PFn);
+					p->blk = vnew(0, sizeof p->blk[0], PFn);
 					a->phi = p;
 					if (!bshas(defs, a->id))
 					if (!bshas(u, a->id)) {
diff --git a/util.c b/util.c
index 6a33d1a..ab4a90b 100644
--- a/util.c
+++ b/util.c
@@ -116,7 +116,7 @@ vnew(ulong len, size_t esz, Pool pool)
 
 	for (cap=VMin; cap<len; cap*=2)
 		;
-	f = pool == Pheap ? emalloc : alloc;
+	f = pool == PHeap ? emalloc : alloc;
 	v = f(cap * esz + sizeof(Vec));
 	v->mag = VMag;
 	v->cap = cap;
@@ -132,7 +132,7 @@ vfree(void *p)
 
 	v = (Vec *)p - 1;
 	assert(v->mag == VMag);
-	if (v->pool == Pheap) {
+	if (v->pool == PHeap) {
 		v->mag = 0;
 		free(v);
 	}
@@ -172,7 +172,7 @@ intern(char *s)
 	if (n == 1<<(32-IBits))
 		die("interning table overflow");
 	if (n == 0)
-		b->str = vnew(1, sizeof b->str[0], Pheap);
+		b->str = vnew(1, sizeof b->str[0], PHeap);
 	else if ((n & (n-1)) == 0)
 		vgrow(&b->str, n+n);