libctf: split serialization and file writeout into its own file
authorNick Alcock <nick.alcock@oracle.com>
Thu, 18 Mar 2021 12:37:52 +0000 (12:37 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 18 Mar 2021 12:37:53 +0000 (12:37 +0000)
commitbf4c3185a5a031824855a93c3476ae276236df12
treea1837dd0d4e692dbe182840e0623f3a648515814
parent087945261c7523ed895e48a97418ec6dee6cdb67
libctf: split serialization and file writeout into its own file

The code to serialize CTF dicts just gets bigger and bigger as the
dictionary's complexity grows: adding symtypetabs almost doubled it on
its own.  It's long past time to split this out into its own source
file, accompanied by the functions that do the actual writeout.

This leaves ctf-create.c populated exclusively by functions related to
actual writable dict creation (ctf_add_*, ctf_create etc), and leaves
both files a much more reasonable size.

libctf/ChangeLog
2021-03-18  Nick Alcock  <nick.alcock@oracle.com>

* ctf-create.c (symtypetab_delete_nonstatic_vars): Move
into ctf-serialize.c.
(ctf_symtab_skippable): Likewise.
(CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
(CTF_SYMTYPETAB_EMIT_PAD): Likewise.
(CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
(symtypetab_density): Likewise.
(emit_symtypetab): Likewise.
(emit_symtypetab_index): Likewise.
(ctf_copy_smembers): Likewise.
(ctf_copy_lmembers): Likewise.
(ctf_copy_emembers): Likewise.
(ctf_sort_var): Likewise.
(ctf_serialize): Likewise.
(ctf_gzwrite): Likewise.
(ctf_compress_write): Likewise.
(ctf_write_mem): Likewise.
(ctf_write): Likewise.
* ctf-serialize.c: New file.
* Makefile.am (libctf_nobfd_la_SOURCES): Add it.
* Makefile.in: Regenerate.
libctf/ChangeLog
libctf/Makefile.am
libctf/Makefile.in
libctf/ctf-create.c
libctf/ctf-serialize.c [new file with mode: 0644]