-/* Stack of control and binding constructs we are currently inside.
-
- These constructs begin when you call `expand_start_WHATEVER'
- and end when you call `expand_end_WHATEVER'. This stack records
- info about how the construct began that tells the end-function
- what to do. It also may provide information about the construct
- to alter the behavior of other constructs within the body.
- For example, they may affect the behavior of C `break' and `continue'.
-
- Each construct gets one `struct nesting' object.
- All of these objects are chained through the `all' field.
- `nesting_stack' points to the first object (innermost construct).
- The position of an entry on `nesting_stack' is in its `depth' field.
-
- Each type of construct has its own individual stack.
- For example, loops have `cond_stack'. Each object points to the
- next object of the same type through the `next' field.
-
- Some constructs are visible to `break' exit-statements and others
- are not. Which constructs are visible depends on the language.
- Therefore, the data structure allows each construct to be visible
- or not, according to the args given when the construct is started.
- The construct is visible if the `exit_label' field is non-null.
- In that case, the value should be a CODE_LABEL rtx. */
-
-struct nesting GTY(())
-{
- struct nesting *all;
- struct nesting *next;
- int depth;
- rtx exit_label;
- enum nesting_desc {
- COND_NESTING,
- BLOCK_NESTING,
- CASE_NESTING
- } desc;
- union nesting_u
- {
- /* For conds (if-then and if-then-else statements). */
- struct nesting_cond
- {
- /* Label for the end of the if construct.
- There is none if EXITFLAG was not set
- and no `else' has been seen yet. */
- rtx endif_label;
- /* Label for the end of this alternative.
- This may be the end of the if or the next else/elseif. */
- rtx next_label;
- } GTY ((tag ("COND_NESTING"))) cond;
- /* For variable binding contours. */
- struct nesting_block
- {
- /* Sequence number of this binding contour within the function,
- in order of entry. */
- int block_start_count;
- /* The NOTE that starts this contour.
- Used by expand_goto to check whether the destination
- is within each contour or not. */
- rtx first_insn;
- /* The saved target_temp_slot_level from our outer block.
- We may reset target_temp_slot_level to be the level of
- this block, if that is done, target_temp_slot_level
- reverts to the saved target_temp_slot_level at the very
- end of the block. */
- int block_target_temp_slot_level;
- } GTY ((tag ("BLOCK_NESTING"))) block;
- /* For switch (C) or case (Pascal) statements. */
- struct nesting_case
- {
- /* The insn after which the case dispatch should finally
- be emitted. Zero for a dummy. */
- rtx start;
- /* A list of case labels; it is first built as an AVL tree.
- During expand_end_case, this is converted to a list, and may be
- rearranged into a nearly balanced binary tree. */
- struct case_node *case_list;
- /* Label to jump to if no case matches. */
- tree default_label;
- /* The expression to be dispatched on. */
- tree index_expr;
- } GTY ((tag ("CASE_NESTING"))) case_stmt;
- } GTY ((desc ("%1.desc"))) data;
-};
-
-/* Allocate and return a new `struct nesting'. */
-
-#define ALLOC_NESTING() ggc_alloc (sizeof (struct nesting))
-
-/* Pop the nesting stack element by element until we pop off
- the element which is at the top of STACK.
- Update all the other stacks, popping off elements from them
- as we pop them from nesting_stack. */
-
-#define POPSTACK(STACK) \
-do { struct nesting *target = STACK; \
- struct nesting *this; \
- do { this = nesting_stack; \
- if (cond_stack == this) \
- cond_stack = cond_stack->next; \
- if (block_stack == this) \
- block_stack = block_stack->next; \
- if (case_stack == this) \
- case_stack = case_stack->next; \
- nesting_depth = nesting_stack->depth - 1; \
- nesting_stack = this->all; } \
- while (this != target); } while (0)
-\f
-
-struct stmt_status GTY(())
-{
- /* Chain of all pending binding contours. */
- struct nesting * x_block_stack;
-
- /* If any new stacks are added here, add them to POPSTACKS too. */
-
- /* Chain of all pending conditional statements. */
- struct nesting * x_cond_stack;
-
- /* Chain of all pending case or switch statements. */
- struct nesting * x_case_stack;
-
- /* Separate chain including all of the above,
- chained through the `all' field. */
- struct nesting * x_nesting_stack;
-
- /* Number of entries on nesting_stack now. */
- int x_nesting_depth;
-
- /* Number of binding contours started so far in this function. */
- int x_block_start_count;
-
- /* Location of last line-number note, whether we actually
- emitted it or not. */
- location_t x_emit_locus;
-};
-
-#define block_stack (cfun->stmt->x_block_stack)
-#define cond_stack (cfun->stmt->x_cond_stack)
-#define case_stack (cfun->stmt->x_case_stack)
-#define nesting_stack (cfun->stmt->x_nesting_stack)
-#define nesting_depth (cfun->stmt->x_nesting_depth)
-#define current_block_start_count (cfun->stmt->x_block_start_count)
-#define emit_locus (cfun->stmt->x_emit_locus)
-