aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-create.c
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-06-03 13:23:42 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 17:57:48 +0100
commit9850ce4d7bb89d4f9216dd5eebc88156bf31b70b (patch)
tree76da014bb6484adce339dc3d24fa3fee4b971907 /libctf/ctf-create.c
parent2c9ca36be17839467dc88dd8c857bb3226f782e6 (diff)
downloadbinutils-9850ce4d7bb89d4f9216dd5eebc88156bf31b70b.zip
binutils-9850ce4d7bb89d4f9216dd5eebc88156bf31b70b.tar.gz
binutils-9850ce4d7bb89d4f9216dd5eebc88156bf31b70b.tar.bz2
libctf: add ctf_forwardable_kind
The internals of the deduplicator want to know if something is a type that can have a forward to it fairly often, often enough that inlining it brings a noticeable performance gain. Convert the one place in libctf that can already benefit, even though it doesn't bring any sort of performance gain there. libctf/ * ctf-inlines.h (ctf_forwardable_kind): New. * ctf-create.c (ctf_add_forward): Use it.
Diffstat (limited to 'libctf/ctf-create.c')
-rw-r--r--libctf/ctf-create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index c13b83d..d50367d 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -1241,7 +1241,7 @@ ctf_add_forward (ctf_file_t *fp, uint32_t flag, const char *name,
ctf_dtdef_t *dtd;
ctf_id_t type = 0;
- if (kind != CTF_K_STRUCT && kind != CTF_K_UNION && kind != CTF_K_ENUM)
+ if (!ctf_forwardable_kind (kind))
return (ctf_set_errno (fp, ECTF_NOTSUE));
/* If the type is already defined or exists as a forward tag, just