xcoffout.c (xcoffout_declare_function): Always strip storage class encoding.
authorDavid Edelsohn <edelsohn@gnu.org>
Mon, 13 Dec 2004 19:44:03 +0000 (19:44 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 13 Dec 2004 19:44:03 +0000 (14:44 -0500)
        * xcoffout.c (xcoffout_declare_function): Always strip storage
        class encoding.

From-SVN: r92101

gcc/ChangeLog
gcc/xcoffout.c

index 5ed662d1231248c346affbfeee91c2dfb0d0c663..96a1648fb078e452fad892a812501a362b7c334c 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-13  David Edelsohn  <edelsohn@gnu.org>
+
+       * xcoffout.c (xcoffout_declare_function): Always strip storage
+       class encoding.
+
 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR target/18964
index f79755a58a869792a7a9f6f9ff1024b79b195454..a2d8a33ba5f09992bf22d024721f67f628e3e1ed 100644 (file)
@@ -405,22 +405,18 @@ xcoffout_end_block (unsigned int line, unsigned int n)
 void
 xcoffout_declare_function (FILE *file, tree decl, const char *name)
 {
-  int i;
+  size_t len;
 
   if (*name == '*')
     name++;
-  else
-    for (i = 0; name[i]; ++i)
-      {
-       if (name[i] == '[')
-         {
-           char *n = alloca (i + 1);
-           strncpy (n, name, i);
-           n[i] = '\0';
-           name = n;
-           break;
-         }
-      }
+  len = strlen (name);
+  if (name[len - 1] == ']')
+    {
+      char *n = alloca (len - 3);
+      strncpy (n, name, len - 4);
+      n[len - 4] = '\0';
+      name = n;
+    }
 
   /* Any pending .bi or .ei must occur before the .function pseudo op.
      Otherwise debuggers will think that the function is in the previous