aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.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/tree.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/tree.c')
-rw-r--r--gcc/tree.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 59c17c7..2e5bf5c 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8752,4 +8752,40 @@ function_args_count (tree fntype)
return num;
}
+/* If BLOCK is inlined from an __attribute__((__artificial__))
+ routine, return pointer to location from where it has been
+ called. */
+location_t *
+block_nonartificial_location (tree block)
+{
+ location_t *ret = NULL;
+
+ while (block && TREE_CODE (block) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (block))
+ {
+ tree ao = BLOCK_ABSTRACT_ORIGIN (block);
+
+ while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ ao = BLOCK_ABSTRACT_ORIGIN (ao);
+
+ if (TREE_CODE (ao) == FUNCTION_DECL)
+ {
+ /* If AO is an artificial inline, point RET to the
+ call site locus at which it has been inlined and continue
+ the loop, in case AO's caller is also an artificial
+ inline. */
+ if (DECL_DECLARED_INLINE_P (ao)
+ && lookup_attribute ("artificial", DECL_ATTRIBUTES (ao)))
+ ret = &BLOCK_SOURCE_LOCATION (block);
+ else
+ break;
+ }
+ else if (TREE_CODE (ao) != BLOCK)
+ break;
+
+ block = BLOCK_SUPERCONTEXT (block);
+ }
+ return ret;
+}
+
#include "gt-tree.h"