- TREE_COMPLEXITY (t) = lineno;
-
- for (i = 0; i < length; i++)
- TREE_OPERAND (t, i) = va_arg (p, tree);
-
- va_end (p);
- return t;
-}
-
-/* Some statements, like for-statements or if-statements, require a
- condition. This condition can be a declaration. If T is such a
- declaration it is processed, and an expression appropriate to use
- as the condition is returned. Otherwise, T itself is returned. */
-
-tree
-expand_cond (t)
- tree t;
-{
- if (t && TREE_CODE (t) == TREE_LIST)
- {
- expand_stmt (TREE_PURPOSE (t));
- return TREE_VALUE (t);
- }
- else
- return t;
-}
-
-/* Create RTL for the local static variable DECL. */
-
-void
-make_rtl_for_local_static (decl)
- tree decl;
-{
- const char *asmspec = NULL;
-
- /* If we inlined this variable, we could see it's declaration
- again. */
- if (TREE_ASM_WRITTEN (decl))
- return;
-
- /* If the DECL_ASSEMBLER_NAME is not the same as the DECL_NAME, then
- either we already created RTL for this DECL (and since it was a
- local variable, its DECL_ASSMEMBLER_NAME got hacked up to prevent
- clashes with other local statics with the same name by a previous
- call to make_decl_rtl), or the user explicitly requested a
- particular assembly name for this variable, using the GNU
- extension for this purpose:
-
- int i asm ("j");
-
- There's no way to know which case we're in, here. But, it turns
- out we're safe. If there's already RTL, then
- rest_of_decl_compilation ignores the ASMSPEC parameter, so we
- may as well not pass it in. If there isn't RTL, then we didn't
- already create RTL, which means that the modification to
- DECL_ASSEMBLER_NAME came only via the explicit extension. */
- if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
- && !DECL_RTL (decl))
- asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
- rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0);
-}
-
-/* Let the back-end know about DECL. */
-
-void
-emit_local_var (decl)
- tree decl;
-{
- /* Create RTL for this variable. */
- if (!DECL_RTL (decl))
- {
- if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
- /* The user must have specified an assembler name for this
- variable. Set that up now. */
- rest_of_decl_compilation
- (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
- /*top_level=*/0, /*at_end=*/0);
- else
- expand_decl (decl);
- }
-
- /* Actually do the initialization. */
- if (stmts_are_full_exprs_p ())
- expand_start_target_temps ();
-
- expand_decl_init (decl);
-
- if (stmts_are_full_exprs_p ())
- expand_end_target_temps ();
-}
-
-/* Helper for generating the RTL at the beginning of a scope. */
-
-void
-genrtl_do_pushlevel ()
-{
- emit_line_note (input_filename, lineno);
- clear_last_expr ();
-}
-
-/* Generate the RTL for DESTINATION, which is a GOTO_STMT. */
-
-void
-genrtl_goto_stmt (destination)
- tree destination;
-{
- if (TREE_CODE (destination) == IDENTIFIER_NODE)
- abort ();
-
- /* We warn about unused labels with -Wunused. That means we have to
- mark the used labels as used. */
- if (TREE_CODE (destination) == LABEL_DECL)
- TREE_USED (destination) = 1;
-
- emit_line_note (input_filename, lineno);
-
- if (TREE_CODE (destination) == LABEL_DECL)
- {
- label_rtx (destination);
- expand_goto (destination);
- }
- else
- expand_computed_goto (destination);
-}
-
-/* Generate the RTL for EXPR, which is an EXPR_STMT. */
-
-void
-genrtl_expr_stmt (expr)
- tree expr;
-{
- if (expr != NULL_TREE)
- {
- emit_line_note (input_filename, lineno);
-
- if (stmts_are_full_exprs_p ())
- expand_start_target_temps ();
-
- if (expr != error_mark_node)
- expand_expr_stmt (expr);
-
- if (stmts_are_full_exprs_p ())
- expand_end_target_temps ();
- }
-}
-
-/* Generate the RTL for T, which is a DECL_STMT. */
-
-void
-genrtl_decl_stmt (t)
- tree t;
-{
- tree decl;
- emit_line_note (input_filename, lineno);
- decl = DECL_STMT_DECL (t);
- /* If this is a declaration for an automatic local
- variable, initialize it. Note that we might also see a
- declaration for a namespace-scope object (declared with
- `extern'). We don't have to handle the initialization
- of those objects here; they can only be declarations,
- rather than definitions. */
- if (TREE_CODE (decl) == VAR_DECL
- && !TREE_STATIC (decl)
- && !DECL_EXTERNAL (decl))
- {
- /* Let the back-end know about this variable. */
- if (!anon_aggr_type_p (TREE_TYPE (decl)))
- emit_local_var (decl);
- else
- expand_anon_union_decl (decl, NULL_TREE,
- DECL_ANON_UNION_ELEMS (decl));
- }
- else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
- {
- if (DECL_ARTIFICIAL (decl) && ! TREE_USED (decl))
- /* Do not emit unused decls. This is not just an
- optimization. We really do not want to emit
- __PRETTY_FUNCTION__ etc, if they're never used. */
- DECL_IGNORED_P (decl) = 1;
- else
- make_rtl_for_local_static (decl);
- }
- else if (TREE_CODE (decl) == LABEL_DECL
- && C_DECLARED_LABEL_FLAG (decl))
- declare_nonlocal_label (decl);
- else if (lang_expand_decl_stmt)
- (*lang_expand_decl_stmt) (t);
-}
-
-/* Generate the RTL for T, which is an IF_STMT. */
-
-void
-genrtl_if_stmt (t)
- tree t;
-{
- tree cond;
- genrtl_do_pushlevel ();
- cond = expand_cond (IF_COND (t));
- emit_line_note (input_filename, lineno);
- expand_start_cond (cond, 0);
- if (THEN_CLAUSE (t))
- expand_stmt (THEN_CLAUSE (t));
- if (ELSE_CLAUSE (t))
- {
- expand_start_else ();
- expand_stmt (ELSE_CLAUSE (t));
- }
- expand_end_cond ();
-}
-
-/* Generate the RTL for T, which is a WHILE_STMT. */
-
-void
-genrtl_while_stmt (t)
- tree t;
-{
- tree cond;
- emit_nop ();
- emit_line_note (input_filename, lineno);
- expand_start_loop (1);
- genrtl_do_pushlevel ();
-
- cond = expand_cond (WHILE_COND (t));
- emit_line_note (input_filename, lineno);
- expand_exit_loop_if_false (0, cond);
- genrtl_do_pushlevel ();
-
- expand_stmt (WHILE_BODY (t));
-
- expand_end_loop ();
-}
-
-/* Generate the RTL for T, which is a DO_STMT. */
-
-void
-genrtl_do_stmt (t)
- tree t;
-{
- tree cond = DO_COND (t);
-
- /* Recognize the common special-case of do { ... } while (0) and do
- not emit the loop widgetry in this case. In particular this
- avoids cluttering the rtl with dummy loop notes, which can affect
- alignment of adjacent labels. */
- if (integer_zerop (cond))
- {
- expand_start_null_loop ();
- expand_stmt (DO_BODY (t));
- expand_end_null_loop ();
- }
- else
- {
- emit_nop ();
- emit_line_note (input_filename, lineno);
- expand_start_loop_continue_elsewhere (1);