mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 08:44:42 +08:00
cplus-dem.c (demangle_function_name): Changed to return value indicating if a name was correctly demangled.
2008-01-23 Thiago Jung Bauermann <bauerman@br.ibm.com> * cplus-dem.c (demangle_function_name): Changed to return value indicating if a name was correctly demangled. (iterate_demangle_function): Use demangle_function_name return value. From-SVN: r131754
This commit is contained in:
parent
3ca06a6878
commit
62b445b31c
@ -1,3 +1,10 @@
|
|||||||
|
2008-01-23 Thiago Jung Bauermann <bauerman@br.ibm.com>
|
||||||
|
|
||||||
|
* cplus-dem.c (demangle_function_name): Changed to return value
|
||||||
|
indicating if a name was correctly demangled.
|
||||||
|
(iterate_demangle_function): Use demangle_function_name return
|
||||||
|
value.
|
||||||
|
|
||||||
2008-01-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
2008-01-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
||||||
|
|
||||||
PR other/33768
|
PR other/33768
|
||||||
|
@ -414,7 +414,7 @@ static int do_type (struct work_stuff *, const char **, string *);
|
|||||||
|
|
||||||
static int do_arg (struct work_stuff *, const char **, string *);
|
static int do_arg (struct work_stuff *, const char **, string *);
|
||||||
|
|
||||||
static void
|
static int
|
||||||
demangle_function_name (struct work_stuff *, const char **, string *,
|
demangle_function_name (struct work_stuff *, const char **, string *,
|
||||||
const char *);
|
const char *);
|
||||||
|
|
||||||
@ -2493,10 +2493,7 @@ iterate_demangle_function (struct work_stuff *work, const char **mangled,
|
|||||||
"__"-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
|
||||||
|| strstr (scan + 2, "__") == NULL)
|
|| strstr (scan + 2, "__") == NULL)
|
||||||
{
|
return demangle_function_name (work, mangled, declp, scan);
|
||||||
demangle_function_name (work, mangled, declp, scan);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Save state so we can restart if the guess at the correct "__" was
|
/* Save state so we can restart if the guess at the correct "__" was
|
||||||
wrong. */
|
wrong. */
|
||||||
@ -2513,10 +2510,12 @@ iterate_demangle_function (struct work_stuff *work, const char **mangled,
|
|||||||
|
|
||||||
while (scan[2])
|
while (scan[2])
|
||||||
{
|
{
|
||||||
demangle_function_name (work, mangled, declp, scan);
|
if (demangle_function_name (work, mangled, declp, scan))
|
||||||
success = demangle_signature (work, mangled, declp);
|
{
|
||||||
if (success)
|
success = demangle_signature (work, mangled, declp);
|
||||||
break;
|
if (success)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset demangle state for the next round. */
|
/* Reset demangle state for the next round. */
|
||||||
*mangled = mangle_init;
|
*mangled = mangle_init;
|
||||||
@ -4421,7 +4420,9 @@ demangle_nested_args (struct work_stuff *work, const char **mangled,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/* Returns 1 if a valid function name was found or 0 otherwise. */
|
||||||
|
|
||||||
|
static int
|
||||||
demangle_function_name (struct work_stuff *work, const char **mangled,
|
demangle_function_name (struct work_stuff *work, const char **mangled,
|
||||||
string *declp, const char *scan)
|
string *declp, const char *scan)
|
||||||
{
|
{
|
||||||
@ -4461,13 +4462,13 @@ demangle_function_name (struct work_stuff *work, const char **mangled,
|
|||||||
{
|
{
|
||||||
work -> constructor += 1;
|
work -> constructor += 1;
|
||||||
string_clear (declp);
|
string_clear (declp);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (strcmp (declp -> b, "__dt") == 0)
|
else if (strcmp (declp -> b, "__dt") == 0)
|
||||||
{
|
{
|
||||||
work -> destructor += 1;
|
work -> destructor += 1;
|
||||||
string_clear (declp);
|
string_clear (declp);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4575,6 +4576,13 @@ demangle_function_name (struct work_stuff *work, const char **mangled,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If a function name was obtained but it's not valid, we were not
|
||||||
|
successful. */
|
||||||
|
if (LEN_STRING (declp) == 1 && declp->b[0] == '.')
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* a mini string-handling package */
|
/* a mini string-handling package */
|
||||||
|
Loading…
Reference in New Issue
Block a user