[multiple changes]
[gcc.git] / gcc / gengtype.c
index 3f9ad0b3463934f81b594a65197eaa8a5f1ad1db..5d219c37e27e87c8fd08843e18c1ab05aae5c93e 100644 (file)
@@ -1,5 +1,5 @@
 /* Process source files and output type information.
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -119,23 +119,6 @@ error_at_line (const struct fileloc *pos, const char *msg, ...)
 
   va_end (ap);
 }
-
-/* asprintf, but produces fatal message on out-of-memory.  */
-char *
-xasprintf (const char *format, ...)
-{
-  int n;
-  char *result;
-  va_list ap;
-
-  va_start (ap, format);
-  n = vasprintf (&result, format, ap);
-  if (result == NULL || n < 0)
-    fatal ("out of memory");
-  va_end (ap);
-
-  return result;
-}
 \f
 /* Locate the ultimate base class of struct S.  */
 
@@ -628,7 +611,9 @@ create_user_defined_type (const char *type_name, struct fileloc *pos)
         comma-separated list of strings, implicitly assumed to
         be type names, potentially with "*" characters.  */
       char *arg = open_bracket + 1;
-      char *next;
+      /* Workaround -Wmaybe-uninitialized false positive during
+        profiledbootstrap by initializing it.  */
+      char *next = NULL;
       char *type_id = strtoken (arg, ",>", &next);
       pair_p fields = 0;
       while (type_id)
@@ -1256,6 +1241,7 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
            case 'i':
            case 'n':
            case 'w':
+           case 'r':
              t = scalar_tp;
              subname = "rt_int";
              break;
@@ -1283,8 +1269,6 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
                t = scalar_tp, subname = "rt_int";
              else if (i == DEBUG_EXPR && aindex == 0)
                t = tree_tp, subname = "rt_tree";
-             else if (i == REG && aindex == 1)
-               t = reg_attrs_tp, subname = "rt_reg";
              else if (i == SYMBOL_REF && aindex == 1)
                t = symbol_union_tp, subname = "";
              else if (i == JUMP_TABLE_DATA && aindex >= 4)
@@ -1359,6 +1343,9 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
                                    "CONSTANT_POOL_ADDRESS_P (&%0)");
        }
 
+      if (i == REG)
+       subfields = create_field (subfields, reg_attrs_tp, "reg.attrs");
+
       if (i == SYMBOL_REF)
        {
          /* Add the "block_sym" field if SYMBOL_REF_HAS_BLOCK_INFO_P
@@ -1625,7 +1612,7 @@ static outf_p
 create_file (const char *name, const char *oname)
 {
   static const char *const hdr[] = {
-    "   Copyright (C) 2004-2014 Free Software Foundation, Inc.\n",
+    "   Copyright (C) 2004-2015 Free Software Foundation, Inc.\n",
     "\n",
     "This file is part of GCC.\n",
     "\n",
@@ -1726,12 +1713,18 @@ open_base_files (void)
     static const char *const ifiles[] = {
       "config.h", "system.h", "coretypes.h", "tm.h", "insn-codes.h",
       "hashtab.h", "splay-tree.h", "obstack.h", "bitmap.h", "input.h",
-      "tree.h", "rtl.h", "wide-int.h", "hashtab.h", "hash-set.h", "vec.h",
+      "hash-set.h", "machmode.h", "vec.h", "double-int.h", "input.h",
+      "alias.h", "symtab.h", "options.h", 
+      "wide-int.h", "inchash.h",
+      "tree.h", "fold-const.h", "rtl.h",
       "machmode.h", "tm.h", "hard-reg-set.h", "input.h", "predict.h",
-      "function.h", "insn-config.h", "expr.h", "alloc-pool.h",
-      "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
+      "function.h", "insn-config.h", "flags.h", "statistics.h",
+      "real.h", "fixed-value.h", "tree.h", "expmed.h", "dojump.h",
+      "explow.h", "calls.h", "emit-rtl.h", "varasm.h", "stmt.h",
+      "expr.h", "alloc-pool.h",
+      "basic-block.h", "cselib.h", "insn-addr.h",
       "optabs.h", "libfuncs.h", "debug.h", "ggc.h", 
-      "hash-table.h", "vec.h", "ggc.h", "dominance.h", "cfg.h", "basic-block.h",
+      "ggc.h", "dominance.h", "cfg.h", "basic-block.h",
       "tree-ssa-alias.h", "internal-fn.h", "gimple-fold.h", "tree-eh.h",
       "gimple-expr.h", "is-a.h",
       "gimple.h", "gimple-iterator.h", "gimple-ssa.h", "tree-cfg.h",