summaryrefslogtreecommitdiff
path: root/gcc/ipa-hello-world.c
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-03-09 12:38:58 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-04-28 23:35:48 +0200
commite03585e86ff1ee055c5350be4ec9754cecb97fb1 (patch)
tree185e16d2a3370a2a2d5d6e16b58540dfc88e7f65 /gcc/ipa-hello-world.c
parent5f9159551a2e2b60b20c1e2a2e76052d0f06c6b7 (diff)
Find out if function escapes
Diffstat (limited to 'gcc/ipa-hello-world.c')
-rw-r--r--gcc/ipa-hello-world.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ipa-hello-world.c b/gcc/ipa-hello-world.c
index e5f69308e3c..85092f85453 100644
--- a/gcc/ipa-hello-world.c
+++ b/gcc/ipa-hello-world.c
@@ -210,6 +210,26 @@ is_variable_escaping(varpool_node *vnode)
return vnode->externally_visible;
}
+static bool
+is_function_escaping(cgraph_node *cnode)
+{
+ gcc_assert(cnode);
+ return cnode->externally_visible;
+}
+
+void
+is_any_function_escaping(type_map &escape_map)
+{
+ cgraph_node *cnode = NULL;
+ FOR_EACH_FUNCTION (cnode)
+ {
+ log("function name = %s\n", cnode->name());
+ bool is_escaping = is_function_escaping(cnode);
+ log("function %s is escaping %s\n", cnode->name(), is_escaping ? "true" : "false");
+
+ }
+}
+
void
is_any_variable_escaping(type_map &escape_map)
{
@@ -237,6 +257,7 @@ iphw_execute()
type_map escape_map;
collect_types(escape_map);
is_any_variable_escaping(escape_map);
+ is_any_function_escaping(escape_map);
print_types(escape_map);
return 0;
}