libctf: core type lookup
authorNick Alcock <nick.alcock@oracle.com>
Wed, 24 Apr 2019 10:03:37 +0000 (11:03 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 28 May 2019 16:08:14 +0000 (17:08 +0100)
commit316afdb130346e44622229793d1fb8d391059f8d
tree869ce03acfa79331cb89475282a11ca7e1cdb7e4
parent143dce8481f09f60704ab52b98cf8fe6d8b29fc9
libctf: core type lookup

Finally we get to the functions used to actually look up and enumerate
properties of types in a container (names, sizes, members, what type a
pointer or cv-qual references, determination of whether two types are
assignment-compatible, etc).

With a very few exceptions these do not work for types newly added via
ctf_add_*(): they only work on types in read-only containers, or types
added before the most recent call to ctf_update().

This also adds support for lookup of "variables" (string -> type ID
mappings) and for generation of C type names corresponding to a type ID.

libctf/
* ctf-decl.c: New file.
* ctf-types.c: Likewise.
* ctf-impl.h: New declarations.

include/
* ctf-api.h (ctf_visit_f): New definition.
(ctf_member_f): Likewise.
(ctf_enum_f): Likewise.
(ctf_variable_f): Likewise.
(ctf_type_f): Likewise.
(ctf_type_isparent): Likewise.
(ctf_type_ischild): Likewise.
(ctf_type_resolve): Likewise.
(ctf_type_aname): Likewise.
(ctf_type_lname): Likewise.
(ctf_type_name): Likewise.
(ctf_type_sizee): Likewise.
(ctf_type_align): Likewise.
(ctf_type_kind): Likewise.
(ctf_type_reference): Likewise.
(ctf_type_pointer): Likewise.
(ctf_type_encoding): Likewise.
(ctf_type_visit): Likewise.
(ctf_type_cmp): Likewise.
(ctf_type_compat): Likewise.
(ctf_member_info): Likewise.
(ctf_array_info): Likewise.
(ctf_enum_name): Likewise.
(ctf_enum_value): Likewise.
(ctf_member_iter): Likewise.
(ctf_enum_iter): Likewise.
(ctf_type_iter): Likewise.
(ctf_variable_iter): Likewise.
include/ChangeLog
include/ctf-api.h
libctf/ChangeLog
libctf/ctf-decl.c [new file with mode: 0644]
libctf/ctf-impl.h
libctf/ctf-types.c [new file with mode: 0644]