]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ipa-ref.h
sh.c: Do not include algorithm.
[thirdparty/gcc.git] / gcc / ipa-ref.h
index d2de006b3ca5bbafb1369deea0014e8eda4e8ab3..ed75c008599eb84081fbb3574497e6badb3e1238 100644 (file)
@@ -18,6 +18,9 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef GCC_IPA_REF_H
+#define GCC_IPA_REF_H
+
 struct cgraph_node;
 class varpool_node;
 class symtab_node;
@@ -29,7 +32,8 @@ enum GTY(()) ipa_ref_use
   IPA_REF_LOAD,
   IPA_REF_STORE,
   IPA_REF_ADDR,
-  IPA_REF_ALIAS
+  IPA_REF_ALIAS,
+  IPA_REF_CHKP
 };
 
 /* Record of reference in callgraph or varpool.  */
@@ -54,7 +58,7 @@ public:
   gimple stmt;
   unsigned int lto_stmt_uid;
   unsigned int referred_index;
-  ENUM_BITFIELD (ipa_ref_use) use:2;
+  ENUM_BITFIELD (ipa_ref_use) use:3;
   unsigned int speculative:1;
 };
 
@@ -82,6 +86,32 @@ public:
     return referring[0];
   }
 
+  /* Return first referring alias.  */
+  struct ipa_ref *first_alias (void)
+  {
+    struct ipa_ref *r = first_referring ();
+
+    return r && r->use == IPA_REF_ALIAS ? r : NULL;
+  }
+
+  /* Return last referring alias.  */
+  struct ipa_ref *last_alias (void)
+  {
+    unsigned int i = 0;
+
+    for(i = 0; i < referring.length (); i++)
+      if (referring[i]->use != IPA_REF_ALIAS)
+       break;
+
+    return i == 0 ? NULL : referring[i - 1];
+  }
+
+  /* Return true if the symbol has an alias.  */
+  bool inline has_aliases_p (void)
+  {
+    return first_alias ();
+  }
+
   /* Clear reference list.  */
   void clear (void)
   {
@@ -101,3 +131,5 @@ public:
      or GGC will try to mark middle of references vectors.  */
   vec<ipa_ref_ptr>  GTY((skip)) referring;
 };
+
+#endif /* GCC_IPA_REF_H */