Commit adddf5bf by Kaveh R. Ghazi Committed by Kaveh Ghazi

cplus-dem.c (mystrstr): Delete.

	* cplus-dem.c (mystrstr): Delete.  All callers changed to use
	strstr instead.

From-SVN: r48476
parent 95574a4c
2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cplus-dem.c (mystrstr): Delete. All callers changed to use
strstr instead.
2001-12-31 Ira Ruben <ira@apple.com> 2001-12-31 Ira Ruben <ira@apple.com>
* aclocal.m4 (libiberty_AC_FUNC_STRNCMP): Use anon mmap as 2nd try. * aclocal.m4 (libiberty_AC_FUNC_STRNCMP): Use anon mmap as 2nd try.
......
...@@ -63,25 +63,6 @@ static char *ada_demangle PARAMS ((const char *, int)); ...@@ -63,25 +63,6 @@ static char *ada_demangle PARAMS ((const char *, int));
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN; extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
static const char *mystrstr PARAMS ((const char *, const char *));
static const char *
mystrstr (s1, s2)
const char *s1, *s2;
{
register const char *p = s1;
register int len = strlen (s2);
for (; (p = strchr (p, *s2)) != 0; p++)
{
if (strncmp (p, s2, len) == 0)
{
return (p);
}
}
return (0);
}
/* In order to allow a single demangler executable to demangle strings /* In order to allow a single demangler executable to demangle strings
using various common values of CPLUS_MARKER, as well as any specific using various common values of CPLUS_MARKER, as well as any specific
one set at compile time, we maintain a string containing all the one set at compile time, we maintain a string containing all the
...@@ -2253,7 +2234,7 @@ arm_pt (work, mangled, n, anchor, args) ...@@ -2253,7 +2234,7 @@ arm_pt (work, mangled, n, anchor, args)
{ {
/* Check if ARM template with "__pt__" in it ("parameterized type") */ /* Check if ARM template with "__pt__" in it ("parameterized type") */
/* Allow HP also here, because HP's cfront compiler follows ARM to some extent */ /* Allow HP also here, because HP's cfront compiler follows ARM to some extent */
if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = mystrstr (mangled, "__pt__"))) if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = strstr (mangled, "__pt__")))
{ {
int len; int len;
*args = *anchor + 6; *args = *anchor + 6;
...@@ -2268,9 +2249,9 @@ arm_pt (work, mangled, n, anchor, args) ...@@ -2268,9 +2249,9 @@ arm_pt (work, mangled, n, anchor, args)
} }
if (AUTO_DEMANGLING || EDG_DEMANGLING) if (AUTO_DEMANGLING || EDG_DEMANGLING)
{ {
if ((*anchor = mystrstr (mangled, "__tm__")) if ((*anchor = strstr (mangled, "__tm__"))
|| (*anchor = mystrstr (mangled, "__ps__")) || (*anchor = strstr (mangled, "__ps__"))
|| (*anchor = mystrstr (mangled, "__pt__"))) || (*anchor = strstr (mangled, "__pt__")))
{ {
int len; int len;
*args = *anchor + 6; *args = *anchor + 6;
...@@ -2283,7 +2264,7 @@ arm_pt (work, mangled, n, anchor, args) ...@@ -2283,7 +2264,7 @@ arm_pt (work, mangled, n, anchor, args)
return 1; return 1;
} }
} }
else if ((*anchor = mystrstr (mangled, "__S"))) else if ((*anchor = strstr (mangled, "__S")))
{ {
int len; int len;
*args = *anchor + 3; *args = *anchor + 3;
...@@ -2584,7 +2565,7 @@ iterate_demangle_function (work, mangled, declp, scan) ...@@ -2584,7 +2565,7 @@ iterate_demangle_function (work, mangled, declp, scan)
/* Do not iterate for some demangling modes, or if there's only one /* Do not iterate for some demangling modes, or if there's only one
"__"-sequence. This is the normal case. */ "__"-sequence. This is the normal case. */
if (ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING if (ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING
|| mystrstr (scan + 2, "__") == NULL) || strstr (scan + 2, "__") == NULL)
{ {
demangle_function_name (work, mangled, declp, scan); demangle_function_name (work, mangled, declp, scan);
return 1; return 1;
...@@ -2727,7 +2708,7 @@ demangle_prefix (work, mangled, declp) ...@@ -2727,7 +2708,7 @@ demangle_prefix (work, mangled, declp)
/* This block of code is a reduction in strength time optimization /* This block of code is a reduction in strength time optimization
of: of:
scan = mystrstr (*mangled, "__"); */ scan = strstr (*mangled, "__"); */
{ {
scan = *mangled; scan = *mangled;
...@@ -2819,7 +2800,7 @@ demangle_prefix (work, mangled, declp) ...@@ -2819,7 +2800,7 @@ demangle_prefix (work, mangled, declp)
{ {
scan++; scan++;
} }
if ((scan = mystrstr (scan, "__")) == NULL || (*(scan + 2) == '\0')) if ((scan = strstr (scan, "__")) == NULL || (*(scan + 2) == '\0'))
{ {
/* No separator (I.E. "__not_mangled"), or empty signature /* No separator (I.E. "__not_mangled"), or empty signature
(I.E. "__not_mangled_either__") */ (I.E. "__not_mangled_either__") */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment