diff options
author | Jeff Law <law@gcc.gnu.org> | 2019-11-16 10:14:14 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2019-11-16 10:14:14 -0700 |
commit | 513e0aa0c4e60757e7e99e479a940812f6107dd9 (patch) | |
tree | dd08e84cc15708a9a190f9963d51d296f6481a0d /libiberty/cp-demint.c | |
parent | 32fc3719e06899d43e2298ad6d0028efe5ec3024 (diff) | |
download | gcc-513e0aa0c4e60757e7e99e479a940812f6107dd9.tar.gz |
[PATCH] Fix slowness in demangler
* cp-demangle.c (d_print_init): Remove const from 4th param.
(cplus_demangle_fill_name): Initialize d->d_counting.
(cplus_demangle_fill_extended_operator): Likewise.
(cplus_demangle_fill_ctor): Likewise.
(cplus_demangle_fill_dtor): Likewise.
(d_make_empty): Likewise.
(d_count_templates_scopes): Remobe const from 3rd param,
Return on dc->d_counting > 1,
Increment dc->d_counting.
* cp-demint.c (cplus_demangle_fill_component): Initialize d->d_counting.
(cplus_demangle_fill_builtin_type): Likewise.
(cplus_demangle_fill_operator): Likewise.
* demangle.h (struct demangle_component): Add member
d_counting.
From-SVN: r278359
Diffstat (limited to 'libiberty/cp-demint.c')
-rw-r--r-- | libiberty/cp-demint.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c index 950e4dc5522..16bf1f8ce6d 100644 --- a/libiberty/cp-demint.c +++ b/libiberty/cp-demint.c @@ -125,6 +125,7 @@ cplus_demangle_fill_component (struct demangle_component *p, p->u.s_binary.left = left; p->u.s_binary.right = right; p->d_printing = 0; + p->d_counting = 0; return 1; } @@ -149,6 +150,7 @@ cplus_demangle_fill_builtin_type (struct demangle_component *p, p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE; p->u.s_builtin.type = &cplus_demangle_builtin_types[i]; p->d_printing = 0; + p->d_counting = 0; return 1; } } @@ -176,6 +178,7 @@ cplus_demangle_fill_operator (struct demangle_component *p, p->type = DEMANGLE_COMPONENT_OPERATOR; p->u.s_operator.op = &cplus_demangle_operators[i]; p->d_printing = 0; + p->d_counting = 0; return 1; } } |