-static
-struct ctf_declaration *ctf_declaration_specifier_visit(FILE *fd,
- int depth, struct list_head *head,
- struct type_scope *type_scope,
- struct definition_scope *definition_scope)
-{
- struct ctf_declaration *declaration;
- struct ctf_type *type;
-
- type = ctf_type_specifier_visit(fd, depth, head, type_scope,
- definition_scope);
- declaration = type->declaration_new(type, definition_scope);
- if (type->id == CTF_TYPE_VARIANT) {
- struct declaration_variant *variant =
- container_of(declaration, struct declaration_variant, p);
- struct declaration *enum_tag =
- lookup_field_declaration(enum_tag_name, definition_scope);
- if (!enum_tag) {
- fprintf(fd, "[error]: expected enumeration tag field %s for variant\n",
- enum_tag_name);
- goto error;
- }
- /* TODO find enum tag */
- ret = variant_declaration_set_tag(variant, enum_tag);
- }
- return declaration;
-error:
- declaration_unref(declaration);
- type_unref(type);
- return NULL;
-}
-