diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2021-02-18 17:03:28 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-03-02 15:09:18 +0000 |
commit | ac36e134d96fa71a2f5c141058e06b57bcc72136 (patch) | |
tree | e6647d27d24de83a812c7960384abec8a9dcec41 /libctf/ctf-link.c | |
parent | eaa2913a7acead8654e7e79ba13c0d22fd70a452 (diff) | |
download | gdb-ac36e134d96fa71a2f5c141058e06b57bcc72136.zip gdb-ac36e134d96fa71a2f5c141058e06b57bcc72136.tar.gz gdb-ac36e134d96fa71a2f5c141058e06b57bcc72136.tar.bz2 |
libctf: reimplement many _iter iterators in terms of _next
Ever since the generator-style _next iterators were introduced, there
have been separate implementations of the functional-style _iter
iterators that do the same thing as _next.
This is annoying and adds more dependencies on the internal guts of the
file format. Rip them all out and replace them with the corresponding
_next iterators. Only ctf_archive_raw_iter and ctf_label_iter survive,
the former because there is no access to the raw binary data of archives
via any _next iterator, and the latter because ctf_label_next hasn't
been implemented (because labels are currently not used for anything).
Tested by reverting the change (already applied) that reimplemented
ctf_member_iter in terms of ctf_member_next, then verifying that the
_iter and _next iterators produced the same results for every iterable
entity within a large type archive.
libctf/ChangeLog
2021-03-02 Nick Alcock <nick.alcock@oracle.com>
* ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
(ctf_enum_iter): Reimplement in terms of ctf_enum_next.
(ctf_type_iter): Reimplement in terms of ctf_type_next.
(ctf_type_iter_all): Likewise.
(ctf_variable_iter): Reimplement in terms of ctf_variable_next.
* ctf-archive.c (ctf_archive_iter_internal): Remove.
(ctf_archive_iter): Reimplement in terms of ctf_archive_next.
Diffstat (limited to 'libctf/ctf-link.c')
0 files changed, 0 insertions, 0 deletions