示例#1
0
void
pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
{
  tree saved_scope = pp->enclosing_scope;
  pp_cxx_decl_specifier_seq (pp, t);
  pp_cxx_declarator (pp, t);
  pp_needs_newline (pp) = true;
  pp->enclosing_scope = DECL_CONTEXT (t);
  if (DECL_SAVED_TREE (t))
    {
      tree body = DECL_SAVED_TREE (t);
      if (TREE_CODE (body) == COMPOUND_STMT
          && TREE_CODE (COMPOUND_BODY (body)) == CTOR_INITIALIZER)
        {
          body = COMPOUND_BODY (body);
          pp_cxx_ctor_initializer (pp, body);
          body = TREE_CHAIN (body);
        }
      pp_cxx_statement (pp, body);
    }
  else
    {
      pp_cxx_semicolon (pp);
      pp_needs_newline (pp) = true;
    }
  pp_flush (pp);
  pp->enclosing_scope = saved_scope;
}
示例#2
0
static void
finish_cdtor (tree body)
{
  tree scope;
  tree block;

  scope = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
  block = poplevel (0, 0, 0);
  SCOPE_STMT_BLOCK (TREE_PURPOSE (scope)) = block;
  SCOPE_STMT_BLOCK (TREE_VALUE (scope)) = block;

  RECHAIN_STMTS (body, COMPOUND_BODY (body));

  finish_function ();
}
示例#3
0
void
genrtl_compound_stmt (tree t)
{
#ifdef ENABLE_CHECKING
    struct nesting *n = current_nesting_level ();
#endif

    expand_stmt (COMPOUND_BODY (t));

#ifdef ENABLE_CHECKING
    /* Make sure that we've pushed and popped the same number of levels.  */
    if (!COMPOUND_STMT_NO_SCOPE (t) && n != current_nesting_level ())
        abort ();
#endif
}