aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-09-25 03:48:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-09-25 01:48:34 +0000
commitba3923391e896c0efdfcd49eb0334525ed8bd2c0 (patch)
treed4102419e20affeb7736989b54eabee0db65012a /gcc/ipa-utils.h
parent20149bd284864c06f0051f50d73ff50be46505f8 (diff)
downloadgcc-ba3923391e896c0efdfcd49eb0334525ed8bd2c0.zip
gcc-ba3923391e896c0efdfcd49eb0334525ed8bd2c0.tar.gz
gcc-ba3923391e896c0efdfcd49eb0334525ed8bd2c0.tar.bz2
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods.
* cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
Diffstat (limited to 'gcc/ipa-utils.h')
-rw-r--r--gcc/ipa-utils.h108
1 files changed, 0 insertions, 108 deletions
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index 409e485..7ff29f8 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -34,114 +34,6 @@ struct ipa_dfs_info {
PTR aux;
};
-/* Context of polymorphic call. This is used by ipa-devirt walkers of the
- type inheritance graph. */
-
-class ipa_polymorphic_call_context {
-public:
- /* The called object appears in an object of type OUTER_TYPE
- at offset OFFSET. When information is not 100% reliable, we
- use SPECULATIVE_OUTER_TYPE and SPECULATIVE_OFFSET. */
- HOST_WIDE_INT offset;
- HOST_WIDE_INT speculative_offset;
- tree outer_type;
- tree speculative_outer_type;
- /* True if outer object may be in construction or destruction. */
- bool maybe_in_construction;
- /* True if outer object may be of derived type. */
- bool maybe_derived_type;
- /* True if speculative outer object may be of derived type. We always
- speculate that construction does not happen. */
- bool speculative_maybe_derived_type;
- /* True if the context is invalid and all calls should be redirected
- to BUILTIN_UNREACHABLE. */
- bool invalid;
-
- /* Build empty "I know nothing" context. */
- ipa_polymorphic_call_context ();
- /* Build polymorphic call context for indirect call E. */
- ipa_polymorphic_call_context (cgraph_edge *e);
- /* Build polymorphic call context for IP invariant CST.
- If specified, OTR_TYPE specify the type of polymorphic call
- that takes CST+OFFSET as a prameter. */
- ipa_polymorphic_call_context (tree cst, tree otr_type = NULL,
- HOST_WIDE_INT offset = 0);
- /* Build context for pointer REF contained in FNDECL at statement STMT.
- if INSTANCE is non-NULL, return pointer to the object described by
- the context. */
- ipa_polymorphic_call_context (tree fndecl, tree ref, gimple stmt,
- tree *instance = NULL);
-
- /* Look for vtable stores or constructor calls to work out dynamic type
- of memory location. */
- bool get_dynamic_type (tree, tree, tree, gimple);
-
- /* Make context non-speculative. */
- void clear_speculation ();
-
- /* Walk container types and modify context to point to actual class
- containing EXPECTED_TYPE as base class. */
- bool restrict_to_inner_class (tree expected_type);
-
- /* Dump human readable context to F. */
- void dump (FILE *f) const;
- void DEBUG_FUNCTION debug () const;
-
-private:
- void set_by_decl (tree, HOST_WIDE_INT);
- bool set_by_invariant (tree, tree, HOST_WIDE_INT);
- void clear_outer_type (tree otr_type = NULL);
-};
-
-/* Build polymorphic call context for indirect call E. */
-
-inline
-ipa_polymorphic_call_context::ipa_polymorphic_call_context (cgraph_edge *e)
-{
- gcc_checking_assert (e->indirect_info->polymorphic);
-
- offset = e->indirect_info->offset;
- speculative_offset = e->indirect_info->speculative_offset;
- outer_type = e->indirect_info->outer_type;
- speculative_outer_type = e->indirect_info->speculative_outer_type;
- maybe_in_construction = e->indirect_info->maybe_in_construction;
- maybe_derived_type = e->indirect_info->maybe_derived_type;
- speculative_maybe_derived_type = e->indirect_info->speculative_maybe_derived_type;
- invalid = false;
-}
-
-/* Build empty "I know nothing" context. */
-
-inline
-ipa_polymorphic_call_context::ipa_polymorphic_call_context ()
-{
- clear_speculation ();
- clear_outer_type ();
- invalid = false;
-}
-
-/* Make context non-speculative. */
-
-inline void
-ipa_polymorphic_call_context::clear_speculation ()
-{
- speculative_outer_type = NULL;
- speculative_offset = 0;
- speculative_maybe_derived_type = false;
-}
-
-/* Produce context specifying all derrived types of OTR_TYPE.
- If OTR_TYPE is NULL or type of the OBJ_TYPE_REF, the context is set
- to dummy "I know nothing" setting. */
-
-inline void
-ipa_polymorphic_call_context::clear_outer_type (tree otr_type)
-{
- outer_type = otr_type ? TYPE_MAIN_VARIANT (otr_type) : NULL;
- offset = 0;
- maybe_derived_type = true;
- maybe_in_construction = true;
-}
/* In ipa-utils.c */
void ipa_print_order (FILE*, const char *, struct cgraph_node**, int);