From 16fcf0f4b99d7108361992bb3f282216e0a0e150 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 14 Dec 2009 16:53:57 +0000 Subject: * 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 --- gcc/cgraph.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'gcc/cgraph.c') 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" -- cgit v1.2.1