OSDN Git Service

2010-05-28 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / c-pretty-print.c
index c4e6e96..b9f9953 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines common to both C and C++ pretty-printers.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
 
@@ -23,10 +23,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "real.h"
-#include "fixed-value.h"
+#include "tree.h"
 #include "intl.h"
 #include "c-pretty-print.h"
+#include "tree-pretty-print.h"
 #include "c-tree.h"
 #include "tree-iterator.h"
 #include "diagnostic.h"
@@ -225,7 +225,11 @@ pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
        const
        restrict                              -- C99
        __restrict__                          -- GNU C
-       volatile    */
+       address-space-qualifier              -- GNU C
+       volatile
+
+   address-space-qualifier:
+       identifier                           -- GNU C  */
 
 void
 pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
@@ -245,6 +249,12 @@ pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
     pp_c_cv_qualifier (pp, "volatile");
   if (qualifiers & TYPE_QUAL_RESTRICT)
     pp_c_cv_qualifier (pp, flag_isoc99 ? "restrict" : "__restrict__");
+
+  if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (t)))
+    {
+      const char *as = c_addr_space_name (TYPE_ADDR_SPACE (t));
+      pp_c_identifier (pp, as);
+    }
 }
 
 /* pointer:
@@ -444,11 +454,17 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
 
     case VECTOR_TYPE:
     case COMPLEX_TYPE:
-      pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
       if (code == COMPLEX_TYPE)
        pp_c_ws_string (pp, flag_isoc99 ? "_Complex" : "__complex__");
       else if (code == VECTOR_TYPE)
-       pp_c_ws_string (pp, "__vector__");
+       {
+         pp_c_ws_string (pp, "__vector");
+         pp_c_left_paren (pp);
+         pp_wide_integer (pp, TYPE_VECTOR_SUBPARTS (t));
+         pp_c_right_paren (pp);
+         pp_c_whitespace (pp);
+       }
+      pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
       break;
 
     default:
@@ -837,7 +853,7 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
          high = ~high + !low;
          low = -low;
        }
-      sprintf (pp_buffer (pp)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX, 
+      sprintf (pp_buffer (pp)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
               (unsigned HOST_WIDE_INT) high, (unsigned HOST_WIDE_INT) low);
       pp_string (pp, pp_buffer (pp)->digit_buffer);
     }
@@ -848,6 +864,9 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
   else if (type == long_long_integer_type_node
           || type == long_long_unsigned_type_node)
     pp_string (pp, "ll");
+  else if (type == int128_integer_type_node
+           || type == int128_unsigned_type_node)
+    pp_string (pp, "I128");
 }
 
 /* Print out a CHARACTER literal.  */
@@ -1943,7 +1962,7 @@ pp_c_conditional_expression (c_pretty_printer *pp, tree e)
 static void
 pp_c_assignment_expression (c_pretty_printer *pp, tree e)
 {
-  if (TREE_CODE (e) == MODIFY_EXPR 
+  if (TREE_CODE (e) == MODIFY_EXPR
       || TREE_CODE (e) == INIT_EXPR)
     {
       pp_c_unary_expression (pp, TREE_OPERAND (e, 0));