aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorAnthony Green <green@cygnus.com>1999-11-28 20:45:34 +0000
committerAnthony Green <green@gcc.gnu.org>1999-11-28 20:45:34 +0000
commit140592a0131cb2dc88d3f55b2671977f20c85be2 (patch)
tree64c16fe212dcb5f1d77505bd5b8e158441e8665e /gcc/tree.h
parent8b4b9b7ad3d1bbc16516a5a73a6ba3c3c21d1822 (diff)
downloadgcc-140592a0131cb2dc88d3f55b2671977f20c85be2.zip
gcc-140592a0131cb2dc88d3f55b2671977f20c85be2.tar.gz
gcc-140592a0131cb2dc88d3f55b2671977f20c85be2.tar.bz2
tree.h (struct tree_decl): Add malloc_flag.
* tree.h (struct tree_decl): Add malloc_flag. (DECL_IS_MALLOC): Define. * c-common.c (attrs): Add A_MALLOC attribute. (init_attributes): Add this attribute to the table. (decl_attributes): Handle malloc attribute. * calls.c (special_function_p): Check for the malloc attribute. * extend.texi (Function Attributes): Document malloc attribute. From-SVN: r30689
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index d805689..fcfa219 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1238,6 +1238,11 @@ struct tree_type
to redefine for any purpose whatever. */
#define DECL_BUILT_IN_NONANSI(NODE) ((NODE)->common.unsigned_flag)
+/* Nonzero in a FUNCTION_DECL means this function should be treated
+ as if it were a malloc, meaning it returns a pointer that is
+ not an alias. */
+#define DECL_IS_MALLOC(NODE) (DECL_CHECK (NODE)->decl.malloc_flag)
+
/* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
specially. */
#define DECL_BIT_FIELD(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
@@ -1370,6 +1375,7 @@ struct tree_decl
unsigned no_instrument_function_entry_exit : 1;
unsigned no_check_memory_usage : 1;
unsigned comdat_flag : 1;
+ unsigned malloc_flag : 1;
/* For a FUNCTION_DECL, if inline, this is the size of frame needed.
If built-in, this is the code for which built-in function.