summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-14 16:53:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-14 16:53:57 +0000
commit16fcf0f4b99d7108361992bb3f282216e0a0e150 (patch)
treec56a297fcbcb5b2a3c120a9cbdc79b0ad1dc5625 /gcc/cgraph.c
parentc9feb8a90ebb6e7f5cb815fc91724d9241b1500e (diff)
downloadgcc-16fcf0f4b99d7108361992bb3f282216e0a0e150.tar.gz
* cgraph.h (cgraph_set_nothrow_flag, cgraph_set_readonly_flag,
cgraph_set_pure_flag, cgraph_set_looping_const_or_pure_flag): New prototypes. * cgraph.c (cgraph_set_nothrow_flag, cgraph_set_readonly_flag, cgraph_set_pure_flag, cgraph_set_looping_const_or_pure_flag): New functions. * except.h (set_nothrow_function_flags): Remove prototype. * except.c (set_nothrow_function_flags): Use cgraph_set_nothrow_flag. Make static. * ipa-pure-const.c (propagate): Use cgraph_set_nothrow_flag, cgraph_set_readonly_flag, cgraph_set_pure_flag and cgraph_set_looping_const_or_pure_flag. (local_pure_const): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 0ed097a8b0b..fc7ba1a50ba 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2208,4 +2208,53 @@ cgraph_make_node_local (struct cgraph_node *node)
}
}
+/* Set TREE_NOTHROW on NODE's decl and on same_body aliases of NODE
+ if any to NOTHROW. */
+
+void
+cgraph_set_nothrow_flag (struct cgraph_node *node, bool nothrow)
+{
+ struct cgraph_node *alias;
+ TREE_NOTHROW (node->decl) = nothrow;
+ for (alias = node->same_body; alias; alias = alias->next)
+ TREE_NOTHROW (alias->decl) = nothrow;
+}
+
+/* Set TREE_READONLY on NODE's decl and on same_body aliases of NODE
+ if any to READONLY. */
+
+void
+cgraph_set_readonly_flag (struct cgraph_node *node, bool readonly)
+{
+ struct cgraph_node *alias;
+ TREE_READONLY (node->decl) = readonly;
+ for (alias = node->same_body; alias; alias = alias->next)
+ TREE_READONLY (alias->decl) = readonly;
+}
+
+/* Set DECL_PURE_P on NODE's decl and on same_body aliases of NODE
+ if any to PURE. */
+
+void
+cgraph_set_pure_flag (struct cgraph_node *node, bool pure)
+{
+ struct cgraph_node *alias;
+ DECL_PURE_P (node->decl) = pure;
+ for (alias = node->same_body; alias; alias = alias->next)
+ DECL_PURE_P (alias->decl) = pure;
+}
+
+/* Set DECL_LOOPING_CONST_OR_PURE_P on NODE's decl and on
+ same_body aliases of NODE if any to LOOPING_CONST_OR_PURE. */
+
+void
+cgraph_set_looping_const_or_pure_flag (struct cgraph_node *node,
+ bool looping_const_or_pure)
+{
+ struct cgraph_node *alias;
+ DECL_LOOPING_CONST_OR_PURE_P (node->decl) = looping_const_or_pure;
+ for (alias = node->same_body; alias; alias = alias->next)
+ DECL_LOOPING_CONST_OR_PURE_P (alias->decl) = looping_const_or_pure;
+}
+
#include "gt-cgraph.h"