]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/44426 (gcc 4.5.0 requires c9x compiler to build)
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Jun 2010 17:10:02 +0000 (19:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Jun 2010 17:10:02 +0000 (19:10 +0200)
PR bootstrap/44426
* sel-sched-dump.h (sel_prepare_string_for_dot_label): Remove
prototype.
(sel_print_to_dot): Remove macro.
(sel_print): Likewise.  New prototype.
* sel-sched-dump.c (sel_prepare_string_for_dot_label): Make static.
(sel_print): New function.

From-SVN: r161102

gcc/ChangeLog
gcc/sel-sched-dump.c
gcc/sel-sched-dump.h

index 739d926d3b19696cd89cda6ef364a15262da8d35..7b6356e92eaa7799942962ad7baee1407c45b96e 100644 (file)
@@ -1,3 +1,13 @@
+2010-06-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/44426
+       * sel-sched-dump.h (sel_prepare_string_for_dot_label): Remove
+       prototype.
+       (sel_print_to_dot): Remove macro.
+       (sel_print): Likewise.  New prototype.
+       * sel-sched-dump.c (sel_prepare_string_for_dot_label): Make static.
+       (sel_print): New function.
+
 2010-06-20  Gerald Pfeifer  <gerald@pfeifer.com>
 
        Backport from mainline:
index 5fce7cf6b9e88a8887d1d56cc7c1d0a8bf6040d2..84aa95081829b3af50a7809aff5067a76438fcb2 100644 (file)
@@ -565,7 +565,7 @@ replace_str_in_buf (char *buf, const char *str1, const char *str2)
 }
 
 /* Replace characters in BUF that have special meaning in .dot file.  */
-void
+static void
 sel_prepare_string_for_dot_label (char *buf)
 {
   static char specials_from[7][2] = { "<", ">", "{", "|", "}", "\"",
@@ -578,6 +578,28 @@ sel_prepare_string_for_dot_label (char *buf)
     replace_str_in_buf (buf, specials_from[i], specials_to[i]);
 }
 
+/* This function acts like printf but dumps to the sched_dump file.  */
+void
+sel_print (const char *fmt, ...)
+{
+  va_list ap;
+  va_start (ap, fmt);
+  if (sched_dump_to_dot_p)
+    {
+      char *message;
+      if (vasprintf (&message, fmt, ap) >= 0 && message != NULL)
+       {
+         message = (char *) xrealloc (message, 2 * strlen (message) + 1);
+         sel_prepare_string_for_dot_label (message);
+         fprintf (sched_dump, "%s", message);
+         free (message);
+       }
+    }
+  else
+    vfprintf (sched_dump, fmt, ap);
+  va_end (ap);
+}
+
 /* Dump INSN with FLAGS.  */
 static void
 sel_dump_cfg_insn (insn_t insn, int flags)
index 70750f9cdcd22709e50e32e5a6e0f91c62d1fe4b..c8773e0e3f44fa2134921a95d4bd6c47ccbd0816 100644 (file)
@@ -177,34 +177,13 @@ extern void dump_insn_1 (insn_t, int);
 extern void dump_insn (insn_t);
 extern void debug_insn (insn_t);
 
-extern void sel_prepare_string_for_dot_label (char *);
-
 /* When this flag is on, we are dumping to the .dot file.
    When it is off, we are dumping to log.  */
 extern bool sched_dump_to_dot_p;
-
-/* This macro acts like printf but dumps information to the .dot file.  
-   Used when dumping control flow.  */
-#define sel_print_to_dot(...)                           \
-  do {                                                  \
-    int __j = 1 + 2 * snprintf (NULL, 0, __VA_ARGS__);  \
-    char *__s = XALLOCAVEC (char, __j);                 \
-    snprintf (__s, __j, __VA_ARGS__);                   \
-    sel_prepare_string_for_dot_label (__s);             \
-    fprintf (sched_dump, "%s", __s);                    \
-  } while (0)
-
-/* This macro acts like printf but dumps to the sched_dump file.  */
-#define sel_print(...)                                 \
-  do {                                                 \
-    if (sched_dump_to_dot_p)                            \
-      sel_print_to_dot (__VA_ARGS__);                   \
-    else                                                \
-      fprintf (sched_dump, __VA_ARGS__);                \
-  } while (0)
 \f
 
 /* Functions from sel-sched-dump.c.  */
+extern void sel_print (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
 extern const char * sel_print_insn (const_rtx, int);
 extern void free_sel_dump_data (void);