-/**
- * generate declaration for all types
- */
-static void finish_types(stabs_handle *h, waitq *wq)
-{
- ir_type *tp;
-
- while (! waitq_empty(wq)) {
- tp = waitq_get(wq);
-
- switch (get_type_tpop_code(tp)) {
- case tpo_method:
- if (is_method_type_ready(tp)) {
- if (get_method_n_ress(tp) <= 1)
- gen_method_type(h, tp);
- else {
- fprintf(stderr, "Warning: Cannot create stabs debug info for type %s\n", get_type_name(tp));
- } /* if */
- SET_TYPE_READY(tp);
- continue;
- } /* if */
- break;
- case tpo_class:
- case tpo_union:
- case tpo_struct:
- if (is_compound_type_ready(tp)) {
- gen_struct_union_type(h, tp);
- SET_TYPE_READY(tp);
- continue;
- } /* if */
- break;
- case tpo_array:
- if (IS_TYPE_READY(get_array_element_type(tp))) {
- gen_array_type(h, tp);
- SET_TYPE_READY(tp);
- continue;
- } /* if */
- break;
- case tpo_pointer:
- if (IS_TYPE_READY(get_pointer_points_to_type(tp))) {
- gen_pointer_type(h, tp);
- SET_TYPE_READY(tp);
- continue;
- } /* if */
- break;
- default:
- assert(! "Unknown tpop code");
- } /* switch */
-
- /* still not ready, defer type output */
- pdeq_putr(wq, tp);
- } /* while */
+ switch (get_type_tpop_code(tp)) {
+ case tpo_method:
+ gen_method_type(env, tp);
+ break;
+ case tpo_class:
+ case tpo_union:
+ case tpo_struct:
+ gen_struct_union_type(env, tp);
+ break;
+ case tpo_enumeration:
+ gen_enum_type(env->h, tp);
+ break;
+ case tpo_primitive:
+ gen_primitive_type(env->h, tp);
+ break;
+ case tpo_array:
+ gen_array_type(env, tp);
+ break;
+ case tpo_pointer:
+ gen_pointer_type(env, tp);
+ break;
+ case tpo_unknown:
+ /* the unknown type: ignore */
+ SET_TYPE_READY(tp);
+ break;
+ default:
+ assert(! "Unknown tpop code");
+ } /* switch */
+ } /* while */