-/* 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;
- /* True if we are currently emitting insns in an area of
- output code that is controlled by a conditional
- expression. This is used by the cleanup handling code to
- generate conditional cleanup actions. */
- int conditional_code;
- /* A place to move the start of the exception region for any
- of the conditional cleanups, must be at the end or after
- the start of the last unconditional cleanup, and before any
- conditional branch points. */
- rtx last_unconditional_cleanup;
- } 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;
- /* Type that INDEX_EXPR should be converted to. */
- tree nominal_type;
- /* Name of this kind of statement, for warnings. */
- const char *printname;
- /* Used to save no_line_numbers till we see the first case label.
- We set this to -1 when we see the first case label in this
- case statement. */
- int line_number_status;
- } 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
-/* In some cases it is impossible to generate code for a forward goto
- until the label definition is seen. This happens when it may be necessary
- for the goto to reset the stack pointer: we don't yet know how to do that.
- So expand_goto puts an entry on this fixup list.
- Each time a binding contour that resets the stack is exited,
- we check each fixup.
- If the target label has now been defined, we can insert the proper code. */
-
-struct goto_fixup GTY(())
-{
- /* Points to following fixup. */
- struct goto_fixup *next;
- /* Points to the insn before the jump insn.
- If more code must be inserted, it goes after this insn. */
- rtx before_jump;
- /* The LABEL_DECL that this jump is jumping to, or 0
- for break, continue or return. */
- tree target;
- /* The BLOCK for the place where this goto was found. */
- tree context;
- /* The CODE_LABEL rtx that this is jumping to. */
- rtx target_rtl;
- /* Number of binding contours started in current function
- before the label reference. */
- int block_start_count;
-};
-
-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;
-
- struct goto_fixup *x_goto_fixup_chain;
-};
-
-#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)
-#define goto_fixup_chain (cfun->stmt->x_goto_fixup_chain)
-
-/* Nonzero if we are using EH to handle cleanups. */
-int using_eh_for_cleanups_p = 0;
-