Commit 53de5204 by Gabriel Dos Reis Committed by Gabriel Dos Reis

c-pretty-print.h (pp_type_specifier_seq): Fix thinko.

        * c-pretty-print.h (pp_type_specifier_seq): Fix thinko.
        * c-pretty-print.c: Fix formatting.
        (pp_c_integer_constant): Append type annotation to literals.  Tidy.
        (pp_c_type_specifier): Tidy.
        (pp_c_compound_literal): New function.
        (pp_c_initializer): Simplify..
        (pp_c_initializer_list): Likewise.
        (pp_c_brace_enclosed_initializer_list): New function.
        (pp_c_postfix_expression): Simplify.

cp/
        * error.c (dump_type): Simplify.  Use pp_type_specifier_seq for
        "C" types.
        * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko.

From-SVN: r71511
parent 1ea8e73b
2003-09-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-pretty-print.h (pp_type_specifier_seq): Fix thinko.
* c-pretty-print.c: Fix formatting.
(pp_c_integer_constant): Append type annotation to literals. Tidy.
(pp_c_type_specifier): Tidy.
(pp_c_compound_literal): New function.
(pp_c_initializer): Simplify..
(pp_c_initializer_list): Likewise.
(pp_c_brace_enclosed_initializer_list): New function.
(pp_c_postfix_expression): Simplify.
2003-09-17 Alexandre Oliva <aoliva@redhat.com> 2003-09-17 Alexandre Oliva <aoliva@redhat.com>
* config/mn10300/mn10300.md (andsi3, iorsi3, xorsi3, * config/mn10300/mn10300.md (andsi3, iorsi3, xorsi3,
......
...@@ -106,7 +106,7 @@ struct c_pretty_print_info ...@@ -106,7 +106,7 @@ struct c_pretty_print_info
#define pp_abstract_declarator(PP, D) \ #define pp_abstract_declarator(PP, D) \
pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D) pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D)
#define pp_type_specifier_seq(PPI, D) \ #define pp_type_specifier_seq(PPI, D) \
pp_c_base (PPI)->type_specifie_seqr (pp_c_base (PPI), D) pp_c_base (PPI)->type_specifier_seq (pp_c_base (PPI), D)
#define pp_declarator(PPI, D) \ #define pp_declarator(PPI, D) \
pp_c_base (PPI)->declarator (pp_c_base (PPI), D) pp_c_base (PPI)->declarator (pp_c_base (PPI), D)
#define pp_direct_declarator(PPI, D) \ #define pp_direct_declarator(PPI, D) \
......
2003-09-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
* error.c (dump_type): Simplify. Use pp_type_specifier_seq for
"C" types.
* cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko.
2003-09-17 Richard Henderson <rth@redhat.com> 2003-09-17 Richard Henderson <rth@redhat.com>
* semantics.c (expand_body): Don't save/restore input_location. * semantics.c (expand_body): Don't save/restore input_location.
......
...@@ -993,14 +993,13 @@ pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t) ...@@ -993,14 +993,13 @@ pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t)
static void static void
pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t) pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
{ {
pp_c_type_qualifier_list (pp_c_base (pp), t);
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case TEMPLATE_DECL: case TEMPLATE_DECL:
case TEMPLATE_TYPE_PARM: case TEMPLATE_TYPE_PARM:
case TYPE_DECL: case TYPE_DECL:
case BOUND_TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM:
pp_c_type_qualifier_list (pp_c_base (pp), t);
pp_cxx_simple_type_specifier (pp, t); pp_cxx_simple_type_specifier (pp, t);
break; break;
......
...@@ -338,45 +338,14 @@ dump_type (tree t, int flags) ...@@ -338,45 +338,14 @@ dump_type (tree t, int flags)
dump_decl (t, flags & ~TFF_DECL_SPECIFIERS); dump_decl (t, flags & ~TFF_DECL_SPECIFIERS);
break; break;
case COMPLEX_TYPE:
pp_string (cxx_pp, "__complex__ ");
dump_type (TREE_TYPE (t), flags);
break;
case VECTOR_TYPE:
pp_string (cxx_pp, "__vector__ ");
{
/* The subtype of a VECTOR_TYPE is something like intQI_type_node,
which has no name and is not very useful for diagnostics. So
look up the equivalent C type and print its name. */
tree elt = TREE_TYPE (t);
elt = c_common_type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
dump_type (elt, flags);
}
break;
case INTEGER_TYPE: case INTEGER_TYPE:
if (!TREE_UNSIGNED (TYPE_MAIN_VARIANT (t)) && TREE_UNSIGNED (t))
pp_string (cxx_pp, "unsigned ");
else if (TREE_UNSIGNED (TYPE_MAIN_VARIANT (t)) && !TREE_UNSIGNED (t))
pp_string (cxx_pp, "signed ");
/* fall through. */
case REAL_TYPE: case REAL_TYPE:
case VOID_TYPE: case VOID_TYPE:
case BOOLEAN_TYPE: case BOOLEAN_TYPE:
{ case COMPLEX_TYPE:
tree type; case VECTOR_TYPE:
dump_qualifiers (t, after); pp_base (cxx_pp)->padding = pp_none;
type = flags & TFF_CHASE_TYPEDEF ? TYPE_MAIN_VARIANT (t) : t; pp_type_specifier_seq (cxx_pp, t);
if (TYPE_NAME (type) && TYPE_IDENTIFIER (type))
pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (type));
else
/* Types like intQI_type_node and friends have no names.
These don't come up in user error messages, but it's nice
to be able to print them from the debugger. */
pp_identifier (cxx_pp, "<anonymous>");
}
break; break;
case TEMPLATE_TEMPLATE_PARM: case TEMPLATE_TEMPLATE_PARM:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment