diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-03-14 01:59:16 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-03-14 01:59:16 +0000 |
commit | 36dbb93d9fa6420bb5ecaee0d42ede4c3bcba129 (patch) | |
tree | 1ed98236146ff8a31ea06a48829690af91367819 /gcc/calls.c | |
parent | 7733611d0c077cbfa7825731e9b89e014bbfc3ba (diff) | |
download | gcc-36dbb93d9fa6420bb5ecaee0d42ede4c3bcba129.zip gcc-36dbb93d9fa6420bb5ecaee0d42ede4c3bcba129.tar.gz gcc-36dbb93d9fa6420bb5ecaee0d42ede4c3bcba129.tar.bz2 |
calls.c (flags_from_decl_or_type): Factor and remove redundant conditional tests.
* calls.c (flags_from_decl_or_type): Factor and remove redundant
conditional tests.
From-SVN: r64347
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index cab6571..f23b939 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -796,23 +796,26 @@ flags_from_decl_or_type (exp) { int flags = 0; tree type = exp; - /* ??? We can't set IS_MALLOC for function types? */ + if (DECL_P (exp)) { struct cgraph_rtl_info *i = cgraph_rtl_info (exp); type = TREE_TYPE (exp); - if (i && i->pure_function) - flags |= ECF_PURE | ECF_LIBCALL_BLOCK; - if (i && i->const_function) - flags |= ECF_CONST | ECF_LIBCALL_BLOCK; + if (i) + { + if (i->pure_function) + flags |= ECF_PURE | ECF_LIBCALL_BLOCK; + if (i->const_function) + flags |= ECF_CONST | ECF_LIBCALL_BLOCK; + } /* The function exp may have the `malloc' attribute. */ - if (DECL_P (exp) && DECL_IS_MALLOC (exp)) + if (DECL_IS_MALLOC (exp)) flags |= ECF_MALLOC; /* The function exp may have the `pure' attribute. */ - if (DECL_P (exp) && DECL_IS_PURE (exp)) + if (DECL_IS_PURE (exp)) flags |= ECF_PURE | ECF_LIBCALL_BLOCK; if (TREE_NOTHROW (exp)) |