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/gimple-fold.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/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 62c71b6..e9cd9aa 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -1007,13 +1007,14 @@ gimple_fold_builtin (gimple stmt) represented by a declaration (i.e. a global or automatically allocated one) or NULL if it cannot be found or is not safe. CST is expected to be an ADDR_EXPR of such object or the function will return NULL. Currently it is - safe to use such binfo only if it has no base binfo (i.e. no ancestors). */ + safe to use such binfo only if it has no base binfo (i.e. no ancestors) + EXPECTED_TYPE is type of the class virtual belongs to. */ tree -gimple_extract_devirt_binfo_from_cst (tree cst) +gimple_extract_devirt_binfo_from_cst (tree cst, tree expected_type) { HOST_WIDE_INT offset, size, max_size; - tree base, type, expected_type, binfo; + tree base, type, binfo; bool last_artificial = false; if (!flag_devirtualize @@ -1022,7 +1023,6 @@ gimple_extract_devirt_binfo_from_cst (tree cst) return NULL_TREE; cst = TREE_OPERAND (cst, 0); - expected_type = TREE_TYPE (cst); base = get_ref_base_and_extent (cst, &offset, &size, &max_size); type = TREE_TYPE (base); if (!DECL_P (base) @@ -1108,7 +1108,8 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) else { tree obj = OBJ_TYPE_REF_OBJECT (callee); - tree binfo = gimple_extract_devirt_binfo_from_cst (obj); + tree binfo = gimple_extract_devirt_binfo_from_cst + (obj, obj_type_ref_class (callee)); if (binfo) { HOST_WIDE_INT token |