diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2024-01-05 11:09:01 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2024-04-19 16:14:46 +0100 |
commit | 4fa4e3d92ac3940305b4521aef3e58555a4aa4b5 (patch) | |
tree | fba1ec4c5d2c39161a6099f221d77fd78029763f /libctf/ctf-create.c | |
parent | b4b77b26e220c065123c455c8ed81086c8481c10 (diff) | |
download | binutils-4fa4e3d92ac3940305b4521aef3e58555a4aa4b5.zip binutils-4fa4e3d92ac3940305b4521aef3e58555a4aa4b5.tar.gz binutils-4fa4e3d92ac3940305b4521aef3e58555a4aa4b5.tar.bz2 |
libctf: delete LCTF_DIRTY
This flag was meant as an optimization to avoid reserializing dicts
unnecessarily. It was critically necessary back when serialization was
done by ctf_update() and you had to call that every time you wanted any
new modifications to the type table to be usable by other types, but
that has been unnecessary for years now, and serialization is only done
once when writing out, which one would naturally assume would always
serialize the dict. Worse, it never really worked: it only tracked
newly-added types, not things like added symbols which might equally
well require reserialization, and it gets in the way of an upcoming
change. Delete entirely.
libctf/
* ctf-create.c (ctf_create): Drop LCTF_DIRTY.
(ctf_discard): Likewise.
(ctf_rollback): Likewise.
(ctf_add_generic): Likewise.
(ctf_set_array): Likewise.
(ctf_add_enumerator): Likewise.
(ctf_add_member_offset): Likewise.
(ctf_add_variable_forced): Likewise.
* ctf-link.c (ctf_link_intern_extern_string): Likewise.
(ctf_link_add_strtab): Likewise.
* ctf-serialize.c (ctf_serialize): Likewise.
* ctf-impl.h (LCTF_DIRTY): Likewise.
(LCTF_LINKING): Renumber.
Diffstat (limited to 'libctf/ctf-create.c')
-rw-r--r-- | libctf/ctf-create.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c index 7aa244e..23bbf92 100644 --- a/libctf/ctf-create.c +++ b/libctf/ctf-create.c @@ -148,7 +148,6 @@ ctf_create (int *errp) fp->ctf_names = names; fp->ctf_dtoldid = 0; fp->ctf_snapshot_lu = 0; - fp->ctf_flags |= LCTF_DIRTY; /* Make sure the ptrtab starts out at a reasonable size. */ @@ -347,10 +346,6 @@ ctf_discard (ctf_dict_t *fp) { fp->ctf_dtoldid, fp->ctf_snapshot_lu + 1 }; - /* Update required? */ - if (!(fp->ctf_flags & LCTF_DIRTY)) - return 0; - return (ctf_rollback (fp, last_update)); } @@ -415,9 +410,6 @@ ctf_rollback (ctf_dict_t *fp, ctf_snapshot_id_t id) fp->ctf_typemax = id.dtd_id; fp->ctf_snapshots = id.snapshot_id; - if (fp->ctf_snapshots == fp->ctf_snapshot_lu) - fp->ctf_flags &= ~LCTF_DIRTY; - return 0; } @@ -482,8 +474,6 @@ ctf_add_generic (ctf_dict_t *fp, uint32_t flag, const char *name, int kind, if (ctf_dtd_insert (fp, dtd, flag, kind) < 0) goto err; /* errno is set for us. */ - fp->ctf_flags |= LCTF_DIRTY; - *rp = dtd; return type; @@ -729,7 +719,6 @@ ctf_set_array (ctf_dict_t *fp, ctf_id_t type, const ctf_arinfo_t *arp) return (ctf_set_errno (ofp, ECTF_BADID)); vlen = (ctf_array_t *) dtd->dtd_vlen; - fp->ctf_flags |= LCTF_DIRTY; vlen->cta_contents = (uint32_t) arp->ctr_contents; vlen->cta_index = (uint32_t) arp->ctr_index; vlen->cta_nelems = arp->ctr_nelems; @@ -1113,8 +1102,6 @@ ctf_add_enumerator (ctf_dict_t *fp, ctf_id_t enid, const char *name, dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, root, vlen + 1); - fp->ctf_flags |= LCTF_DIRTY; - return 0; } @@ -1296,7 +1283,6 @@ ctf_add_member_offset (ctf_dict_t *fp, ctf_id_t souid, const char *name, dtd->dtd_data.ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO (ssize); dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, root, vlen + 1); - fp->ctf_flags |= LCTF_DIRTY; return 0; } @@ -1365,7 +1351,6 @@ ctf_add_variable_forced (ctf_dict_t *fp, const char *name, ctf_id_t ref) return -1; /* errno is set for us. */ } - fp->ctf_flags |= LCTF_DIRTY; return 0; } |