From 22e6bd6f6c83773aad53732b5880eb07d9100499 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Wed, 20 Aug 2014 20:11:53 +0000 Subject: df.h (web_entry_base): Replace existing struct web_entry with a new class web_entry_base with only the... 2014-08-20 Bill Schmidt * df.h (web_entry_base): Replace existing struct web_entry with a new class web_entry_base with only the predecessor member. (unionfind_root): Remove declaration and move to class member. (unionfind_union): Remove declaration and move to friend function. (union_defs): Remove declaration. * web.c (web_entry_base::unionfind_root): Modify to be member function and adjust accessors. (unionfind_union): Modify to be friend function and adjust accessors. (web_entry): New subclass of web_entry_base containing the reg member. (union_match_dups): Modify for struct -> class changes. (union_defs): Likewise. (entry_register): Likewise. (pass_web::execute): Likewise. From-SVN: r214242 --- gcc/df.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'gcc/df.h') diff --git a/gcc/df.h b/gcc/df.h index 9f54023..c20f8a0 100644 --- a/gcc/df.h +++ b/gcc/df.h @@ -1184,20 +1184,22 @@ df_single_use (const df_insn_info *info) /* web */ -/* This entry is allocated for each reference in the insn stream. */ -struct web_entry +class web_entry_base { - /* Pointer to the parent in the union/find tree. */ - struct web_entry *pred; - /* Newly assigned register to the entry. Set only for roots. */ - rtx reg; - void* extra_info; -}; + private: + /* Reference to the parent in the union/find tree. */ + web_entry_base *pred_pvt; + + public: + /* Accessors. */ + web_entry_base *pred () { return pred_pvt; } + void set_pred (web_entry_base *p) { pred_pvt = p; } -extern struct web_entry *unionfind_root (struct web_entry *); -extern bool unionfind_union (struct web_entry *, struct web_entry *); -extern void union_defs (df_ref, struct web_entry *, - unsigned int *used, struct web_entry *, - bool (*fun) (struct web_entry *, struct web_entry *)); + /* Find representative in union-find tree. */ + web_entry_base *unionfind_root (); + + /* Union with another set, returning TRUE if they are already unioned. */ + friend bool unionfind_union (web_entry_base *first, web_entry_base *second); +}; #endif /* GCC_DF_H */ -- cgit v1.1