diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-18 11:22:42 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-18 09:22:42 +0000 |
commit | 1d5755efee57268b43d8fbf38c10cbdbf0a0dd04 (patch) | |
tree | e1a133f48c521b91466f3bcd74ce9eba66d5faa6 /gcc/tree.c | |
parent | 34fdd6b31e8b715b2dfb1490b7c77b4eddacc8df (diff) | |
download | gcc-1d5755efee57268b43d8fbf38c10cbdbf0a0dd04.zip gcc-1d5755efee57268b43d8fbf38c10cbdbf0a0dd04.tar.gz gcc-1d5755efee57268b43d8fbf38c10cbdbf0a0dd04.tar.bz2 |
cgraph.c (cgraph_create_indirect_edge): Discover polymorphic calls and record basic info into indirect_info.
* cgraph.c (cgraph_create_indirect_edge): Discover
polymorphic calls and record basic info into indirect_info.
* gimple-fold.c (gimple_fold_call): When doing BINFO based
devirtualization, ignore objc function calls.
* ipa-cp.c (initialize_node_lattices): Be ready for polymorphic
call with no parm index info.
* ipa-prop.c (ipa_analyze_call_uses): Likewise.
* tree.c (virtual_method_call_p): New function.
* tree.h (virtual_method_call_p): Declare.
From-SVN: r201824
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -11864,6 +11864,27 @@ types_same_for_odr (tree type1, tree type2) return true; } +/* TARGET is a call target of GIMPLE call statement + (obtained by gimple_call_fn). Return true if it is + OBJ_TYPE_REF representing an virtual call of C++ method. + (As opposed to OBJ_TYPE_REF representing objc calls + through a cast where middle-end devirtualization machinery + can't apply.) */ + +bool +virtual_method_call_p (tree target) +{ + if (TREE_CODE (target) != OBJ_TYPE_REF) + return false; + target = TREE_TYPE (target); + gcc_checking_assert (TREE_CODE (target) == POINTER_TYPE); + target = TREE_TYPE (target); + if (TREE_CODE (target) == FUNCTION_TYPE) + return false; + gcc_checking_assert (TREE_CODE (target) == METHOD_TYPE); + return true; +} + /* REF is OBJ_TYPE_REF, return the class the ref corresponds to. */ tree |