Change the symbol access list to pseudo list
Christopher Li
maintainerPATCH 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."
Signed-off-by Christopher Li <[email protected]>
flow.c +4 -4
@@ -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
@@ -294,7 +294,7 @@ static inline void replace_bb_in_list(ststruct 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
@@ -735,11 +735,11 @@ pseudo_t alloc_pseudo(struct instructionstatic 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;
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."Signed-off-by Christopher Li <[email protected]>
Good idea. Merged.
- Josh Triplett