PR bootstrap/56509
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2013 06:01:13 +0000 (06:01 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2013 06:01:13 +0000 (06:01 +0000)
* opts.c (opts_obstack, opts_concat): Moved to...
* opts-common.c (opts_obstack, opts_concat): ... here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196449 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/opts-common.c
gcc/opts.c

index 15897c5..630ed9f 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/56509
+       * opts.c (opts_obstack, opts_concat): Moved to...
+       * opts-common.c (opts_obstack, opts_concat): ... here.
+
 2013-03-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/56461
index 95ca584..9d186a7 100644 (file)
@@ -692,6 +692,40 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
   return result;
 }
 
+/* Obstack for option strings.  */
+
+struct obstack opts_obstack;
+
+/* Like libiberty concat, but allocate using opts_obstack.  */
+
+char *
+opts_concat (const char *first, ...)
+{
+  char *newstr, *end;
+  size_t length = 0;
+  const char *arg;
+  va_list ap;
+
+  /* First compute the size of the result and get sufficient memory.  */
+  va_start (ap, first);
+  for (arg = first; arg; arg = va_arg (ap, const char *))
+    length += strlen (arg);
+  newstr = XOBNEWVEC (&opts_obstack, char, length + 1);
+  va_end (ap);
+
+  /* Now copy the individual pieces to the result string. */
+  va_start (ap, first);
+  for (arg = first, end = newstr; arg; arg = va_arg (ap, const char *))
+    {
+      length = strlen (arg);
+      memcpy (end, arg, length);
+      end += length;
+    }
+  *end = '\0';
+  va_end (ap);
+  return newstr;
+}
+
 /* Decode command-line options (ARGC and ARGV being the arguments of
    main) into an array, setting *DECODED_OPTIONS to a pointer to that
    array and *DECODED_OPTIONS_COUNT to the number of entries in the
index d569b5e..45b12fe 100644 (file)
@@ -268,40 +268,6 @@ add_comma_separated_to_vector (void **pvec, const char *arg)
   *pvec = v;
 }
 
-/* Like libiberty concat, but allocate using opts_obstack.  */
-
-char *
-opts_concat (const char *first, ...)
-{
-  char *newstr, *end;
-  size_t length = 0;
-  const char *arg;
-  va_list ap;
-
-  /* First compute the size of the result and get sufficient memory.  */
-  va_start (ap, first);
-  for (arg = first; arg; arg = va_arg (ap, const char *))
-    length += strlen (arg);
-  newstr = XOBNEWVEC (&opts_obstack, char, length + 1);
-  va_end (ap);
-
-  /* Now copy the individual pieces to the result string. */
-  va_start (ap, first);
-  for (arg = first, end = newstr; arg; arg = va_arg (ap, const char *))
-    {
-      length = strlen (arg);
-      memcpy (end, arg, length);
-      end += length;
-    }
-  *end = '\0';
-  va_end (ap);
-  return newstr;
-}
-
-/* Obstack for option strings.  */
-
-struct obstack opts_obstack;
-
 /* Initialize OPTS and OPTS_SET before using them in parsing options.  */
 
 void