You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "config.h"
#include "system.h"
case INTEGER_TYPE:
case REAL_TYPE:
if (TYPE_NAME (t))
- t = TYPE_NAME (t);
+ {
+ t = TYPE_NAME (t);
+ pp_c_type_specifier (pp, t);
+ }
else
- t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t));
- pp_c_type_specifier (pp, t);
+ {
+ int prec = TYPE_PRECISION (t);
+ t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t));
+ pp_c_type_specifier (pp, t);
+ if (TYPE_PRECISION (t) != prec)
+ {
+ pp_string (pp, ":");
+ pp_decimal_int (pp, prec);
+ }
+ }
break;
case TYPE_DECL:
pp_c_right_paren (pp);
break;
- case STMT_EXPR:
- pp_c_left_paren (pp);
- pp_statement (pp, STMT_EXPR_STMT (e));
- pp_c_right_paren (pp);
- break;
-
default:
/* FIXME: Make sure we won't get into an infinie loop. */
pp_c_left_paren (pp);
if (TREE_CODE (e) == VECTOR_CST)
pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
else if (TREE_CODE (e) == CONSTRUCTOR)
- pp_c_expression_list (pp, CONSTRUCTOR_ELTS (e));
+ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
else
break;
return;
case COMPLEX_TYPE:
if (TREE_CODE (e) == CONSTRUCTOR)
- pp_c_expression_list (pp, CONSTRUCTOR_ELTS (e));
+ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
{
const bool cst = TREE_CODE (e) == COMPLEX_CST;
}
}
+/* Print out V, which contains the elements of a constructor. */
+
+void
+pp_c_constructor_elts (c_pretty_printer *pp, VEC(constructor_elt,gc) *v)
+{
+ unsigned HOST_WIDE_INT ix;
+ tree value;
+
+ FOR_EACH_CONSTRUCTOR_VALUE (v, ix, value)
+ {
+ pp_expression (pp, value);
+ if (ix != VEC_length (constructor_elt, v) - 1)
+ pp_separate_with (pp, ',');
+ }
+}
+
/* Print out an expression-list in parens, as in a function call. */
void
case FIELD_DECL:
case LABEL_DECL:
case ERROR_MARK:
- case STMT_EXPR:
pp_primary_expression (pp, e);
break;
\f
/* Statements. */
-/* statement:
- labeled-statement
- compound-statement
- expression-statement
- selection-statement
- iteration-statement
- jump-statement */
-
void
pp_c_statement (c_pretty_printer *pp, tree stmt)
{
- enum tree_code code;
-
if (stmt == NULL)
return;
if (pp_needs_newline (pp))
pp_newline_and_indent (pp, 0);
- code = TREE_CODE (stmt);
- switch (code)
- {
- /* expression-statement:
- expression(opt) ; */
- case EXPR_STMT:
- pp_expression (pp, EXPR_STMT_EXPR (stmt));
- pp_c_semicolon (pp);
- pp_needs_newline (pp) = true;
- break;
-
- default:
- dump_generic_node (pp_base (pp), stmt, pp_indentation (pp), 0, true);
- break;
- }
+ dump_generic_node (pp_base (pp), stmt, pp_indentation (pp), 0, true);
}
\f