diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 15:46:58 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 15:46:58 -0300 |
commit | d85b86ecc1df40761320a177e79556ee9d574e13 (patch) | |
tree | 3f9fdf7aa6431ba8fbea255255566b5e84d84f09 | |
parent | 7d0bc9334d2f1143a8682b141eda79f8be1bd5d2 (diff) | |
download | pahole-d85b86ecc1df40761320a177e79556ee9d574e13.tar.gz |
emit: Support DW_TAG_atomic_type when emitting definitions for a typedef
I.e. now this works:
typedef unsigned int __uint32_t;
typedef __uint32_t uint32_t;
typedef _Atomic uint32_t atomic_uint32_t;
That is, emitting the atomic_uint32_t works as it notices its _Atomic
that points to uint32_t and then fprintfs it and __uint32_t.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | dwarves_emit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dwarves_emit.c b/dwarves_emit.c index 102b7c48..01b33b7e 100644 --- a/dwarves_emit.c +++ b/dwarves_emit.c @@ -161,6 +161,13 @@ static int typedef__emit_definitions(struct tag *tdef, struct cu *cu, goto emit; switch (type->tag) { + case DW_TAG_atomic_type: + type = cu__type(cu, tdef->type); + if (type) + tag__emit_definitions(type, cu, emissions, fp); + else + fprintf(stderr, "%s: couldn't find the type pointed from _Atomic for '%s'\n", __func__, type__name(def)); + break; case DW_TAG_array_type: tag__emit_definitions(type, cu, emissions, fp); break; |