aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-09-23 11:36:01 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-09-23 11:36:01 +0200
commitd752cfdb114944cf3c800fcc2e4d030ab392c52c (patch)
tree1b72fa7fe409e2cd66cf065ec2671ab20dce7b57 /gcc/c-common.c
parent32eed0456c8c9c52b6b33a375788b09f476542cd (diff)
downloadgcc-d752cfdb114944cf3c800fcc2e4d030ab392c52c.zip
gcc-d752cfdb114944cf3c800fcc2e4d030ab392c52c.tar.gz
gcc-d752cfdb114944cf3c800fcc2e4d030ab392c52c.tar.bz2
tree.h (block_nonartificial_location): New prototype.
* tree.h (block_nonartificial_location): New prototype. * tree.c (block_nonartificial_location): New function. * dwarf2out.c (gen_subprogram_die): Add DW_AT_artificial if artificial attribute is present on abstract inline decl. * c-common.c (handle_artificial_attribute): New function. (c_common_attribute_table): Add artificial attribute. * final.c (override_filename, override_linenum): New variables. (final_scan_insn): For DBX_DEBUG or SDB_DEBUG, set override_filename and override_linenum if inside of a block inlined from __attribute__((__artificial__)) function. (notice_source_line): Honor override_filename and override_linenum. * doc/extend.texi: Document __attribute__((__artificial__)). * config/i386/emmintrin.h: Add __artificial__ attribute to all __always_inline__ functions. * config/i386/mmintrin.h: Likewise. * config/i386/tmmintrin.h: Likewise. * config/i386/mm3dnow.h: Likewise. * config/i386/pmmintrin.h: Likewise. * config/i386/ammintrin.h: Likewise. * config/i386/xmmintrin.h: Likewise. * config/i386/smmintrin.h: Likewise. * config/i386/bmmintrin.h: Likewise. * config/i386/mmintrin-common.h: Likewise. From-SVN: r128686
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 0f4d695..3b5f477 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -515,8 +515,8 @@ static tree handle_cold_attribute (tree *, tree, tree, int, bool *);
static tree handle_noinline_attribute (tree *, tree, tree, int, bool *);
static tree handle_always_inline_attribute (tree *, tree, tree, int,
bool *);
-static tree handle_gnu_inline_attribute (tree *, tree, tree, int,
- bool *);
+static tree handle_gnu_inline_attribute (tree *, tree, tree, int, bool *);
+static tree handle_artificial_attribute (tree *, tree, tree, int, bool *);
static tree handle_flatten_attribute (tree *, tree, tree, int, bool *);
static tree handle_used_attribute (tree *, tree, tree, int, bool *);
static tree handle_unused_attribute (tree *, tree, tree, int, bool *);
@@ -589,6 +589,8 @@ const struct attribute_spec c_common_attribute_table[] =
handle_always_inline_attribute },
{ "gnu_inline", 0, 0, true, false, false,
handle_gnu_inline_attribute },
+ { "artificial", 0, 0, true, false, false,
+ handle_artificial_attribute },
{ "flatten", 0, 0, true, false, false,
handle_flatten_attribute },
{ "used", 0, 0, true, false, false,
@@ -4877,6 +4879,29 @@ handle_gnu_inline_attribute (tree *node, tree name,
return NULL_TREE;
}
+/* Handle an "artificial" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_artificial_attribute (tree *node, tree name,
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (*node))
+ {
+ /* Do nothing else, just set the attribute. We'll get at
+ it later with lookup_attribute. */
+ }
+ else
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
/* Handle a "flatten" attribute; arguments as in
struct attribute_spec.handler. */