diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-23 09:36:01 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-23 09:36:01 +0000 |
commit | 1b16fc454510309e7c6299c24890c40d2b2bc03c (patch) | |
tree | 1b72fa7fe409e2cd66cf065ec2671ab20dce7b57 /gcc/tree.c | |
parent | d4cf8ff76d20953c1113f02bddfc22b61d7dd195 (diff) | |
download | gcc-1b16fc454510309e7c6299c24890c40d2b2bc03c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128686 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 59c17c7e10a..2e5bf5c9337 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" |