diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-29 15:36:18 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-29 15:36:18 +0000 |
commit | ea1760a3a086054b8adba3a4cc28bac3ad84de91 (patch) | |
tree | 7e6eb315a8fd801513f14a09fb9035a39128e409 /gcc/dwarf2out.c | |
parent | 234d19a4437e3761821a29a18c5c97f5c2aaff61 (diff) | |
download | gcc-ea1760a3a086054b8adba3a4cc28bac3ad84de91.tar.gz |
* integrate.c: Remove.
* integrate.h: Remove.
* Makefile.in: Remove make rules for integrate.c and INTEGRATE_H.
* config/arm/t-arm: Remove INTEGRATE_H dependency for target files.
* config/rs6000/t-rs6000: Likewise
* config/spu/t-spu-elf: Likewise.
* function.h (get_hard_reg_initial_val, has_hard_reg_initial_val,
get_hard_reg_initial_reg, emit_initial_value_sets): Move prototypes
from integrate.h to here.
(initial_value_entry): New prototype.
* reload.h (allocate_initial_values): Remove prototype.
* tree.h (set_decl_abstract_flags, set_decl_origin_self): Likewise.
* cse.c (fixed_base_plus_p): Don't handle virtual registers for
integrate.c.
* dwarf2out.c (set_decl_origin_self, set_block_origin_self,
set_decl_abstract_flags, set_block_abstract_flags): Move from
integrate.c to here, the only user.
* expmed.c (extract_fixed_bit_field): Remove outdated comment
about integrate.c.
* function.c: Don't include integrate.h.
(struct initial_value_pair, struct initial_value_struct,
get_hard_reg_initial_val, has_hard_reg_initial_val,
get_hard_reg_initial_reg, emit_initial_value_sets): Move from
integrate.c to here.
(initial_value_entry): New function.
* genemit.c (main): Don't print integrate.h include line.
* ira.c: Don't include integrate.h.
(allocate_initial_values): Move from integrate.c to here.
(ira): Update allocate_initial_values call.
* tree-inline.c: Don't include integrate.h.
(function_attribute_inlinable_p): Moved from integrate.c to here.
* cfgexpand.c: Don't include integrate.h.
* except.c: Likewise.
* langhooks.c: Likewise.
* passes.c: Likewise.
* toplev.c: Likewise.
* config/frv/frv.c: Likewise.
* config/pa/pa.c: Likewise.
* config/spu/spu.c: Likewise.
* config/epiphany/epiphany.c: Likewise.
* config/mep/mep.c: Likewise.
* config/score/score.c: Likewise.
* config/picochip/picochip.c: Likewise.
* config/sh/sh.c: Likewise.
* config/alpha/alpha.c: Likewise.
* config/microblaze/microblaze.c: Likewise.
* config/mips/mips.c: Likewise.
* config/v850/v850.c: Likewise.
* config/mmix/mmix.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/arm/arm.c: Likewise.
* config/s390/s390.c: Likewise.
* config/m32r/m32r.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/c6x/c6x.c: Include function.h instead of integrate.h.
* config/tilegx/tilegx.c: Likewise.
* config/tilepro/tilepro.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 15cbff0a45c..b233d30ce46 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16409,6 +16409,135 @@ gen_type_die_for_member (tree type, tree member, dw_die_ref context_die) pop_decl_scope (); } } + +/* Forward declare these functions, because they are mutually recursive + with their set_block_* pairing functions. */ +static void set_decl_origin_self (tree); +static void set_decl_abstract_flags (tree, int); + +/* Given a pointer to some BLOCK node, if the BLOCK_ABSTRACT_ORIGIN for the + given BLOCK node is NULL, set the BLOCK_ABSTRACT_ORIGIN for the node so + that it points to the node itself, thus indicating that the node is its + own (abstract) origin. Additionally, if the BLOCK_ABSTRACT_ORIGIN for + the given node is NULL, recursively descend the decl/block tree which + it is the root of, and for each other ..._DECL or BLOCK node contained + therein whose DECL_ABSTRACT_ORIGINs or BLOCK_ABSTRACT_ORIGINs are also + still NULL, set *their* DECL_ABSTRACT_ORIGIN or BLOCK_ABSTRACT_ORIGIN + values to point to themselves. */ + +static void +set_block_origin_self (tree stmt) +{ + if (BLOCK_ABSTRACT_ORIGIN (stmt) == NULL_TREE) + { + BLOCK_ABSTRACT_ORIGIN (stmt) = stmt; + + { + tree local_decl; + + for (local_decl = BLOCK_VARS (stmt); + local_decl != NULL_TREE; + local_decl = DECL_CHAIN (local_decl)) + if (! DECL_EXTERNAL (local_decl)) + set_decl_origin_self (local_decl); /* Potential recursion. */ + } + + { + tree subblock; + + for (subblock = BLOCK_SUBBLOCKS (stmt); + subblock != NULL_TREE; + subblock = BLOCK_CHAIN (subblock)) + set_block_origin_self (subblock); /* Recurse. */ + } + } +} + +/* Given a pointer to some ..._DECL node, if the DECL_ABSTRACT_ORIGIN for + the given ..._DECL node is NULL, set the DECL_ABSTRACT_ORIGIN for the + node to so that it points to the node itself, thus indicating that the + node represents its own (abstract) origin. Additionally, if the + DECL_ABSTRACT_ORIGIN for the given node is NULL, recursively descend + the decl/block tree of which the given node is the root of, and for + each other ..._DECL or BLOCK node contained therein whose + DECL_ABSTRACT_ORIGINs or BLOCK_ABSTRACT_ORIGINs are also still NULL, + set *their* DECL_ABSTRACT_ORIGIN or BLOCK_ABSTRACT_ORIGIN values to + point to themselves. */ + +static void +set_decl_origin_self (tree decl) +{ + if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE) + { + DECL_ABSTRACT_ORIGIN (decl) = decl; + if (TREE_CODE (decl) == FUNCTION_DECL) + { + tree arg; + + for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg)) + DECL_ABSTRACT_ORIGIN (arg) = arg; + if (DECL_INITIAL (decl) != NULL_TREE + && DECL_INITIAL (decl) != error_mark_node) + set_block_origin_self (DECL_INITIAL (decl)); + } + } +} + +/* Given a pointer to some BLOCK node, and a boolean value to set the + "abstract" flags to, set that value into the BLOCK_ABSTRACT flag for + the given block, and for all local decls and all local sub-blocks + (recursively) which are contained therein. */ + +static void +set_block_abstract_flags (tree stmt, int setting) +{ + tree local_decl; + tree subblock; + unsigned int i; + + BLOCK_ABSTRACT (stmt) = setting; + + for (local_decl = BLOCK_VARS (stmt); + local_decl != NULL_TREE; + local_decl = DECL_CHAIN (local_decl)) + if (! DECL_EXTERNAL (local_decl)) + set_decl_abstract_flags (local_decl, setting); + + for (i = 0; i < BLOCK_NUM_NONLOCALIZED_VARS (stmt); i++) + { + local_decl = BLOCK_NONLOCALIZED_VAR (stmt, i); + if ((TREE_CODE (local_decl) == VAR_DECL && !TREE_STATIC (local_decl)) + || TREE_CODE (local_decl) == PARM_DECL) + set_decl_abstract_flags (local_decl, setting); + } + + for (subblock = BLOCK_SUBBLOCKS (stmt); + subblock != NULL_TREE; + subblock = BLOCK_CHAIN (subblock)) + set_block_abstract_flags (subblock, setting); +} + +/* Given a pointer to some ..._DECL node, and a boolean value to set the + "abstract" flags to, set that value into the DECL_ABSTRACT flag for the + given decl, and (in the case where the decl is a FUNCTION_DECL) also + set the abstract flags for all of the parameters, local vars, local + blocks and sub-blocks (recursively) to the same setting. */ + +static void +set_decl_abstract_flags (tree decl, int setting) +{ + DECL_ABSTRACT (decl) = setting; + if (TREE_CODE (decl) == FUNCTION_DECL) + { + tree arg; + + for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg)) + DECL_ABSTRACT (arg) = setting; + if (DECL_INITIAL (decl) != NULL_TREE + && DECL_INITIAL (decl) != error_mark_node) + set_block_abstract_flags (DECL_INITIAL (decl), setting); + } +} /* Generate the DWARF2 info for the "abstract" instance of a function which we may later generate inlined and/or out-of-line instances of. */ |