genattrtab.c (write_attr_get): Revert part of last patch to always write out a prototype.
authorAndreas Jaeger <aj@suse.de>
Sat, 5 Jul 2003 11:23:01 +0000 (13:23 +0200)
committerAndreas Jaeger <aj@gcc.gnu.org>
Sat, 5 Jul 2003 11:23:01 +0000 (13:23 +0200)
* genattrtab.c (write_attr_get): Revert part of last patch to
always write out a prototype.

* genemit.c (gen_split): Readd lost unused attributes in last
patch.

From-SVN: r68967

gcc/ChangeLog
gcc/genattrtab.c
gcc/genemit.c

index 3fb943611c9c19e387e2bcc4d663930f8e2bdf6e..f3369639fa46531dc87617acfbdd1ca7e8a8f28e 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-05  Andreas Jaeger  <aj@suse.de>
+
+       * genattrtab.c (write_attr_get): Revert part of last patch to
+       always write out a prototype.
+
+       * genemit.c (gen_split): Readd lost unused attributes in last
+       patch.
+
 2003-07-05  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * cfgloopmanip.c (force_single_succ_latches): Force latch to be
index 990cb0e70f924e1773d3a427a58104dd4d37bafa..a4f6e267f028ded08b55469d5afd5bd1edcb4739 100644 (file)
@@ -4765,6 +4765,21 @@ write_attr_get (struct attr_desc *attr)
      switch we will generate.  */
   common_av = find_most_used (attr);
 
+  /* Write out prototype of function.  */
+  if (!attr->is_numeric)
+    printf ("extern enum attr_%s ", attr->name);
+  else if (attr->unsigned_p)
+    printf ("extern unsigned int ");
+  else
+    printf ("extern int ");
+  /* If the attribute name starts with a star, the remainder is the name of
+     the subroutine to use, instead of `get_attr_...'.  */
+  if (attr->name[0] == '*')
+    printf ("%s (rtx);\n", &attr->name[1]);
+  else
+    printf ("get_attr_%s (%s);\n", attr->name,
+           (attr->is_const ? "void" : "rtx"));
+
   /* Write out start of function, then all values with explicit `case' lines,
      then a `default', then the value with the most uses.  */
   if (!attr->is_numeric)
index edeb1542bd0ba15088aa3f0b59919284c773d27b..35b58a099e09d898c663742263e747cdf53f439f 100644 (file)
@@ -587,13 +587,13 @@ gen_split (rtx split)
     {
       printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
              name, insn_code_number);
-      printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands)\n",
-             name, insn_code_number);
+      printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
+             name, insn_code_number, unused);
     }
   else
     {
       printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number);
-      printf ("rtx\ngen_%s_%d (rtx *operands)\n", name, insn_code_number);
+      printf ("rtx\ngen_%s_%d (rtx *operands%s)\n", name, insn_code_number, unused);
     }
   printf ("{\n");