/* IPA reference lists.
- Copyright (C) 2010-2014 Free Software Foundation, Inc.
+ Copyright (C) 2010-2017 Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
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;
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. */
function. */
bool cannot_lead_to_return ();
+ /* Return true if refernece may be used in address compare. */
+ bool address_matters_p ();
+
/* Return reference list this reference is in. */
struct ipa_ref_list * referring_ref_list (void);
symtab_node *referring;
symtab_node *referred;
- gimple stmt;
+ 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;
};
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)
{
or GGC will try to mark middle of references vectors. */
vec<ipa_ref_ptr> GTY((skip)) referring;
};
+
+#endif /* GCC_IPA_REF_H */