Skip to content

Commit

Permalink
emit: Support DW_TAG_atomic_type when emitting definitions for a typedef
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
acmel committed Oct 13, 2022
1 parent 7d0bc93 commit d85b86e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dwarves_emit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d85b86e

Please sign in to comment.