diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-16 14:38:04 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-16 12:38:04 +0000 |
commit | c49bdb2ee934ab6efddbf9284cba5c76f6f3dd28 (patch) | |
tree | 71b7f3809446131bd9d0c013ed500b7b38f3350e /gcc/tree.c | |
parent | 4042dca916ad7f5a99438e37416d4fed2209cc6d (diff) | |
download | gcc-c49bdb2ee934ab6efddbf9284cba5c76f6f3dd28.zip gcc-c49bdb2ee934ab6efddbf9284cba5c76f6f3dd28.tar.gz gcc-c49bdb2ee934ab6efddbf9284cba5c76f6f3dd28.tar.bz2 |
gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new arugment expected_type.
* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new
arugment expected_type.
(gimple_fold_call): Use it.
* gimple.h (gimple_extract_devirt_binfo_from_cst): Update prototype.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Update.
* ipa-prop.c (ipa_analyze_virtual_call_uses): Use
obj_type_ref_class.
(try_make_edge_direct_virtual_call): Likewise.
* tree.c (obj_type_ref_class): New.
* tree.h (obj_type_ref_class): Use it.
From-SVN: r201789
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -11864,6 +11864,21 @@ types_same_for_odr (tree type1, tree type2) return true; } +/* REF is OBJ_TYPE_REF, return the class the ref corresponds to. */ + +tree +obj_type_ref_class (tree ref) +{ + gcc_checking_assert (TREE_CODE (ref) == OBJ_TYPE_REF); + ref = TREE_TYPE (ref); + gcc_checking_assert (TREE_CODE (ref) == POINTER_TYPE); + ref = TREE_TYPE (ref); + gcc_checking_assert (TREE_CODE (ref) == METHOD_TYPE); + ref = TREE_VALUE (TYPE_ARG_TYPES (ref)); + gcc_checking_assert (TREE_CODE (ref) == POINTER_TYPE); + return TREE_TYPE (ref); +} + /* Try to find a base info of BINFO that would have its field decl at offset OFFSET within the BINFO type and which is of EXPECTED_TYPE. If it can be found, return, otherwise return NULL_TREE. */ |