summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-30 12:54:16 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-30 12:54:16 -0500
commit119bf2c5b0bcbac8c2bc5879de03cda6c9cdfa31 (patch)
tree648e4bcd65d52f9a63393027a541bc39bc3b0850
parent866b981a553a8d30b35f0ea7ba095cdec8692486 (diff)
downloadroux-119bf2c5b0bcbac8c2bc5879de03cda6c9cdfa31.tar.gz
fill class information in filluse()
-rw-r--r--lisc/ssa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisc/ssa.c b/lisc/ssa.c
index 8783d73..a48a649 100644
--- a/lisc/ssa.c
+++ b/lisc/ssa.c
@@ -47,14 +47,17 @@ filluse(Fn *fn)
 		tmp[t].ndef = 0;
 		tmp[t].nuse = 0;
 		tmp[t].phi = 0;
+		tmp[t].cls = 0;
 		if (tmp[t].use == 0)
 			tmp[t].use = vnew(0, sizeof(Use));
 	}
 	for (b=fn->start; b; b=b->link) {
 		for (p=b->phi; p; p=p->link) {
 			assert(rtype(p->to) == RTmp);
-			tmp[p->to.val].ndef++;
-			tmp[p->to.val].phi = p->to.val;
+			t = p->to.val;
+			tmp[t].ndef++;
+			tmp[t].cls = p->cls;
+			tmp[t].phi = p->to.val;
 			for (a=0; a<p->narg; a++)
 				if (rtype(p->arg[a]) == RTmp) {
 					t = p->arg[a].val;
@@ -66,7 +69,9 @@ filluse(Fn *fn)
 		for (i=b->ins; i-b->ins < b->nins; i++) {
 			if (!req(i->to, R)) {
 				assert(rtype(i->to) == RTmp);
-				tmp[i->to.val].ndef++;
+				t = i->to.val;
+				tmp[t].ndef++;
+				tmp[t].cls = i->cls;
 			}
 			for (m=0; m<2; m++)
 				if (rtype(i->arg[m]) == RTmp) {