diff options
author | Ken Raeburn <raeburn@cygnus.com> | 1998-10-11 02:21:54 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@gcc.gnu.org> | 1998-10-11 02:21:54 +0000 |
commit | 7d384cc0b300cace24c008fec600219e4377923c (patch) | |
tree | 7d04180ff0e97d1e5bb80e16c8389a2a43d9e018 /gcc/c-common.c | |
parent | e41887f1fc521f4dde6c0a56ebe3fa1cc1c108aa (diff) | |
download | gcc-7d384cc0b300cace24c008fec600219e4377923c.zip gcc-7d384cc0b300cace24c008fec600219e4377923c.tar.gz gcc-7d384cc0b300cace24c008fec600219e4377923c.tar.bz2 |
Fine-grained control of -fcheck-memory-usage with new no_check_memory_usage attribute.
Fine-grained control of -fcheck-memory-usage with new no_check_memory_usage
attribute. Misc minor bugfixes and tests for it too.
From-SVN: r22983
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 820473f..3157e1d 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -51,7 +51,7 @@ extern struct obstack permanent_obstack; int skip_evaluation; enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION, - A_NO_INSTRUMENT_FUNCTION, + A_NO_CHECK_MEMORY_USAGE, A_NO_INSTRUMENT_FUNCTION, A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED, A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS, A_INIT_PRIORITY}; @@ -394,6 +394,7 @@ init_attributes () add_attribute (A_ALIAS, "alias", 1, 1, 1); add_attribute (A_INIT_PRIORITY, "init_priority", 0, 1, 0); add_attribute (A_NO_INSTRUMENT_FUNCTION, "no_instrument_function", 0, 0, 1); + add_attribute (A_NO_CHECK_MEMORY_USAGE, "no_check_memory_usage", 0, 0, 1); } /* Process the attributes listed in ATTRIBUTES and PREFIX_ATTRIBUTES @@ -889,6 +890,23 @@ decl_attributes (node, attributes, prefix_attributes) warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); break; + case A_NO_CHECK_MEMORY_USAGE: + if (TREE_CODE (decl) != FUNCTION_DECL) + { + error_with_decl (decl, + "`%s' attribute applies only to functions", + IDENTIFIER_POINTER (name)); + } + else if (DECL_INITIAL (decl)) + { + error_with_decl (decl, + "can't set `%s' attribute after definition", + IDENTIFIER_POINTER (name)); + } + else + DECL_NO_CHECK_MEMORY_USAGE (decl) = 1; + break; + case A_INIT_PRIORITY: { tree initp_expr = (args ? TREE_VALUE (args): NULL_TREE); |