aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-04-20 03:04:51 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-04-20 01:04:51 +0000
commit1a3118e962531f1a76397596f5448cc8e0b34b5f (patch)
tree6d94167b35596d4f96592be435d8120a71ea2597 /gcc/ipa-inline-transform.c
parent8d6a938b8923bff9a19ae3fc3544c254eb4fec53 (diff)
downloadgcc-1a3118e962531f1a76397596f5448cc8e0b34b5f.zip
gcc-1a3118e962531f1a76397596f5448cc8e0b34b5f.tar.gz
gcc-1a3118e962531f1a76397596f5448cc8e0b34b5f.tar.bz2
ipa-inline-transform.c (save_inline_function_body): Add comments.
* ipa-inline-transform.c (save_inline_function_body): Add comments. * ipa-inline.c (inline_small_functions): Compute summaries first, populate heap later. From-SVN: r172751
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 0fb2448..25ad84a 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -253,6 +253,9 @@ save_inline_function_body (struct cgraph_node *node)
/* Now node in question has no clones. */
node->clones = NULL;
+ /* Inline clones share decl with the function they are cloned
+ from. Walk the whole clone tree and redirect them all to the
+ new decl. */
if (first_clone->clones)
for (n = first_clone->clones; n != first_clone;)
{
@@ -275,6 +278,8 @@ save_inline_function_body (struct cgraph_node *node)
tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL,
NULL, NULL);
+ /* The function will be short lived and removed after we inline all the clones,
+ but make it internal so we won't confuse ourself. */
DECL_EXTERNAL (first_clone->decl) = 0;
DECL_COMDAT_GROUP (first_clone->decl) = NULL_TREE;
TREE_PUBLIC (first_clone->decl) = 0;