/* 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);
+static void set_decl_abstract_flags (tree, vec<tree> &);
/* 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
}
}
\f
-/* 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. */
+/* Given a pointer to some BLOCK node, set the BLOCK_ABSTRACT flag to 1
+ and if it wasn't 1 before, push it to abstract_vec vector.
+ For all local decls and all local sub-blocks (recursively) do it
+ too. */
static void
-set_block_abstract_flags (tree stmt, int setting)
+set_block_abstract_flags (tree stmt, vec<tree> &abstract_vec)
{
tree local_decl;
tree subblock;
unsigned int i;
- BLOCK_ABSTRACT (stmt) = setting;
+ if (!BLOCK_ABSTRACT (stmt))
+ {
+ abstract_vec.safe_push (stmt);
+ BLOCK_ABSTRACT (stmt) = 1;
+ }
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);
+ set_decl_abstract_flags (local_decl, abstract_vec);
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);
+ set_decl_abstract_flags (local_decl, abstract_vec);
}
for (subblock = BLOCK_SUBBLOCKS (stmt);
subblock != NULL_TREE;
subblock = BLOCK_CHAIN (subblock))
- set_block_abstract_flags (subblock, setting);
+ set_block_abstract_flags (subblock, abstract_vec);
}
-/* Given a pointer to some ..._DECL node, and a boolean value to set the
- "abstract" flags to, set that value into the DECL_ABSTRACT_P 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. */
+/* Given a pointer to some ..._DECL node, set DECL_ABSTRACT_P flag on it
+ to 1 and if it wasn't 1 before, push to abstract_vec vector.
+ 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). */
static void
-set_decl_abstract_flags (tree decl, int setting)
+set_decl_abstract_flags (tree decl, vec<tree> &abstract_vec)
{
- DECL_ABSTRACT_P (decl) = setting;
+ if (!DECL_ABSTRACT_P (decl))
+ {
+ abstract_vec.safe_push (decl);
+ DECL_ABSTRACT_P (decl) = 1;
+ }
+
if (TREE_CODE (decl) == FUNCTION_DECL)
{
tree arg;
for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg))
- DECL_ABSTRACT_P (arg) = setting;
+ if (!DECL_ABSTRACT_P (arg))
+ {
+ abstract_vec.safe_push (arg);
+ DECL_ABSTRACT_P (arg) = 1;
+ }
if (DECL_INITIAL (decl) != NULL_TREE
&& DECL_INITIAL (decl) != error_mark_node)
- set_block_abstract_flags (DECL_INITIAL (decl), setting);
+ set_block_abstract_flags (DECL_INITIAL (decl), abstract_vec);
}
}
dw_die_ref old_die;
tree save_fn;
tree context;
- int was_abstract;
hash_table<decl_loc_hasher> *old_decl_loc_table;
hash_table<dw_loc_list_hasher> *old_cached_dw_loc_list_table;
int old_call_site_count, old_tail_call_site_count;
save_fn = current_function_decl;
current_function_decl = decl;
- was_abstract = DECL_ABSTRACT_P (decl);
- set_decl_abstract_flags (decl, 1);
+ auto_vec<tree, 64> abstract_vec;
+ set_decl_abstract_flags (decl, abstract_vec);
dwarf2out_decl (decl);
- if (! was_abstract)
- set_decl_abstract_flags (decl, 0);
+ unsigned int i;
+ tree t;
+ FOR_EACH_VEC_ELT (abstract_vec, i, t)
+ if (TREE_CODE (t) == BLOCK)
+ BLOCK_ABSTRACT (t) = 0;
+ else
+ DECL_ABSTRACT_P (t) = 0;
current_function_decl = save_fn;
decl_loc_table = old_decl_loc_table;