Skip to contentSkip to conversation

Change the symbol access list to pseudo list

PATCH In review Christopher Li 2 participants 2 messages Jan 17, 2007 Sparse checker

lore
Share & tools
lore

Christopher Li

author maintainer
#0 lore raw

PATCH 1/1 Change the symbol access list to pseudo list

The pseudo list contain more information. It can get to the symbol as well as the usage information. Now it is much easier to answer the question like:
"what function does this functions calls to."

flow.c +4 -4
Index: sparse/flow.c
===================================================================
@@ -709,11 +709,11 @@ external_visibility:
 
 void simplify_symbol_usage(struct entrypoint *ep)
 {
-	struct symbol *sym;
+	pseudo_t pseudo;
 
-	FOR_EACH_PTR(ep->accesses, sym) {
-		simplify_one_symbol(ep, sym);
-	} END_FOR_EACH_PTR(sym);
+	FOR_EACH_PTR(ep->accesses, pseudo) {
+		simplify_one_symbol(ep, pseudo->sym);
+	} END_FOR_EACH_PTR(pseudo);
 }
 
 static void mark_bb_reachable(struct basic_block *bb, unsigned long generation)
linearize.h +1 -1
Index: sparse/linearize.h
===================================================================
@@ -294,7 +294,7 @@ static inline void replace_bb_in_list(st
 struct entrypoint {
 	struct symbol *name;
 	struct symbol_list *syms;
-	struct symbol_list *accesses;
+	struct pseudo_list *accesses;
 	struct basic_block_list *bbs;
 	struct basic_block *active;
 	struct instruction *entry;
linearize.c +5 -5
Index: sparse/linearize.c
===================================================================
@@ -735,11 +735,11 @@ pseudo_t alloc_pseudo(struct instruction
 
 static void clear_symbol_pseudos(struct entrypoint *ep)
 {
-	struct symbol *sym;
+	pseudo_t pseudo;
 
-	FOR_EACH_PTR(ep->accesses, sym) {
-		sym->pseudo = NULL;
-	} END_FOR_EACH_PTR(sym);
+	FOR_EACH_PTR(ep->accesses, pseudo) {
+		pseudo->sym->pseudo = NULL;
+	} END_FOR_EACH_PTR(pseudo);
 }
 
 static pseudo_t symbol_pseudo(struct entrypoint *ep, struct symbol *sym)
@@ -757,7 +757,7 @@ static pseudo_t symbol_pseudo(struct ent
 		pseudo->sym = sym;
 		pseudo->ident = sym->ident;
 		sym->pseudo = pseudo;
-		add_symbol(&ep->accesses, sym);
+		add_pseudo(&ep->accesses, pseudo);
 	}
 	/* Symbol pseudos have neither nr, usage nor def */
 	return pseudo;
#1 lore raw
Quoted 6 lines · Christopher Li

The pseudo list contain more information. It can get to the symbol as well as the usage information. Now it is much easier to answer the question like:
"what function does this functions calls to."

Good idea. Merged.

- Josh Triplett