Browse Source

fill definition site in filluse()

Quentin Carbonneaux 3 years ago
parent
commit
0d50ebaed9
2 changed files with 3 additions and 0 deletions
  1. 1 0
      all.h
  2. 2 0
      ssa.c

+ 1 - 0
all.h

@@ -289,6 +289,7 @@ struct Alias {
 
 
 struct Tmp {
 struct Tmp {
 	char name[NString];
 	char name[NString];
+	Ins *ins;
 	Use *use;
 	Use *use;
 	uint ndef, nuse;
 	uint ndef, nuse;
 	uint bid; /* id of a defining block */
 	uint bid; /* id of a defining block */

+ 2 - 0
ssa.c

@@ -47,6 +47,7 @@ filluse(Fn *fn)
 	/* todo, is this the correct file? */
 	/* todo, is this the correct file? */
 	tmp = fn->tmp;
 	tmp = fn->tmp;
 	for (t=Tmp0; t<fn->ntmp; t++) {
 	for (t=Tmp0; t<fn->ntmp; t++) {
+		tmp[t].ins = 0;
 		tmp[t].bid = -1u;
 		tmp[t].bid = -1u;
 		tmp[t].ndef = 0;
 		tmp[t].ndef = 0;
 		tmp[t].nuse = 0;
 		tmp[t].nuse = 0;
@@ -88,6 +89,7 @@ filluse(Fn *fn)
 					w = WFull;
 					w = WFull;
 				t = i->to.val;
 				t = i->to.val;
 				tmp[t].width = w;
 				tmp[t].width = w;
+				tmp[t].ins = i;
 				tmp[t].bid = b->id;
 				tmp[t].bid = b->id;
 				tmp[t].ndef++;
 				tmp[t].ndef++;
 				tmp[t].cls = i->cls;
 				tmp[t].cls = i->cls;