summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-22 05:59:03 +0000
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-22 05:59:03 +0000
commite560b8d9cb77baff7016abd271de8df5e853b462 (patch)
treec5e2531304006a83b11d90eaec9e6946b7c61670 /gcc/cgraph.c
parentfa3cf1f389ea6e907d71e29349cc96cb428e32a1 (diff)
downloadgcc-e560b8d9cb77baff7016abd271de8df5e853b462.tar.gz
Merged revisions 149500-149501,149503,149506-149509,149511,149513-149516,149518-149520,149523-149526,149530,149532-149537,149540,149544-149553,149556-149586,149590-149591,149593-149594,149603,149611-149612,149614,149624,149626-149629,149631-149632,149635-149639,149641,149644,149647-149650,149653,149655,149661-149680,149685-149686,149688-149691,149694,149696,149700-149702,149704-149705,149712,149714-149716,149719,149721-149722,149725,149730-149731,149733-149734,149736-149737,149740,149744,149746,149748,149750,149755-149757,149762-149763,149765-149766,149770,149772,149774,149778-149782,149785,149789,149792-149794,149797,149800,149803,149805-149813,149816-149817,149819-149822,149825-149827,149829-149836 via svnmerge from
svn+ssh://davidxl@gcc.gnu.org/svn/gcc/trunk git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/lw-ipo@149875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index dc1b51afb75..354254af2e1 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1769,6 +1769,31 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
DECL_WEAK (new_node->decl) = 0;
new_node->clone.tree_map = tree_map;
new_node->clone.args_to_skip = args_to_skip;
+ if (!args_to_skip)
+ new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
+ else if (old_node->clone.combined_args_to_skip)
+ {
+ int newi = 0, oldi = 0;
+ tree arg;
+ bitmap new_args_to_skip = BITMAP_GGC_ALLOC ();
+ struct cgraph_node *orig_node;
+ for (orig_node = old_node; orig_node->clone_of; orig_node = orig_node->clone_of)
+ ;
+ for (arg = DECL_ARGUMENTS (orig_node->decl); arg; arg = TREE_CHAIN (arg), oldi++)
+ {
+ if (bitmap_bit_p (old_node->clone.combined_args_to_skip, oldi))
+ {
+ bitmap_set_bit (new_args_to_skip, oldi);
+ continue;
+ }
+ if (bitmap_bit_p (args_to_skip, newi))
+ bitmap_set_bit (new_args_to_skip, oldi);
+ newi++;
+ }
+ new_node->clone.combined_args_to_skip = new_args_to_skip;
+ }
+ else
+ new_node->clone.combined_args_to_skip = args_to_skip;
new_node->local.externally_visible = 0;
new_node->local.local = 1;
new_node->is_versioned_clone = 1;
@@ -1881,6 +1906,9 @@ cgraph_add_new_function (tree fndecl, bool lowered)
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
gimple_register_cfg_hooks ();
+ /* C++ Thunks are emitted late via this function, gimplify them. */
+ if (!gimple_body (fndecl))
+ gimplify_function_tree (fndecl);
tree_lowering_passes (fndecl);
bitmap_obstack_initialize (NULL);
if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))